I am new to python, so I apologise if the answer is obvious.
I am trying to pick 10 random numbers from a range of 128 numbers. And then if a certain number is present in this list, then print the (list) or a (word) or something.
I can pick the 10 random numbers and print these random numbers, but I am having trouble printing if a number is present in this random list.
I am picking and printing the 10 random numbers in the following way:
import random
list = random.sample(range(128), 10)
print list
I am trying to print (something), if a number in this case 5, is present in this random list in the following way:
import random
list = random.sample(range(128), 10)
if list == 5:
print list