Untitled
renodeIV
python
3 years ago
522 B
1
Indexable
Never
import random # imports module called random (a collection of pre-made code def numberTest(): winners = [6,8,10] # create a variable and set it equal to a list of integers 8, 7, and 10 num = random.randint(1,10) # create a variable called num and set it equal to this function's output if num > 5 and num in winners: # if num greater than 5 and in the list "winner" then... print("Horray!") # print Hooray print(num) # prints the number else: print("Not so great.") print(num)