0

Random list

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

4th Apr 2020, 12:31 PM
CutieRei
CutieRei - avatar
2 ответов
+ 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] =....
4th Apr 2020, 1:05 PM
John Robotane
John Robotane - avatar
4th Apr 2020, 1:13 PM
CutieRei
CutieRei - avatar