Random list | Sololearn: Learn to code for FREE!

0

Random list

Help change random selectes list list = [1,2,3] listr1 = random.choice(list) #changing selected list item code goes here

4/4/2020 12:31:49 PM

CutieRei

2 Answers

New Answer

+1

you can get the index of the selected item using list.index(list1). but you can also get a random index using rand_id=randrange(len(list)) and change the element with this index list[rand_id] =....

0

John Robotane Thanks