import random
intlist = [1,2,3,4,5,]
random_int = random.choice(intlist)
print (intlist, random_int)
fplist = [1.5,2.5,3.5,4.5,5.5]
random_fp = random.choice(fplist)
print (fplist, random_fp)
strlist = ['1', '2', '3', '4', '5']
random_str = random.choice(strlist)
print (strlist, random_str)
mylist = [1, 2, 3, 4, 5, 1.5, 2.5, 3.5, 4.5, 5.5,'1', '2', '3', '4', '5' ]
random_item = random.choice(mylist)
print (mylist, random_item)
myvar1 = 1
myvar2 = 2
myvar3 = 3
varlist =[myvar1, myvar2, myvar3]
random_var = random.choice(varlist)
print (varlist, random_var)
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment