dimanche 1 avril 2018

How to use insert in lists

Ok im trying to create a program which generates a 10 character random password but the created password only has one character instead of ten

count = 0
while count < 10:
    new = []
    new.insert(count,(random.choice([random.choice(string.ascii_letters),random.choice(string.digits)])))
    count = count+1
print(''.join(new))




Aucun commentaire:

Enregistrer un commentaire