lundi 7 décembre 2020

i want to remove the name which is used in last random generate from my names so it is always unique & not repeating in next generate

import random

names = ["raja","laxman","jay","ajay","lopo", "tost","lola","manish", "Vishal"]

idx = random.randint(0, len(names)-1)
    My_lable.config(text = (f"Thief: {names[idx]}") )

#for example if I get raja in 1 generate it should be eliminated from next #generate once all names are used only then it should start using all names again.




Aucun commentaire:

Enregistrer un commentaire