vendredi 21 décembre 2018

how to generate more than 1 random integer [duplicate]

This question already has an answer here:

i am trying to make a simple password program. however i don't know how to generate more than 1 random number.

import random
number = random.randint(1,9)
print(number * 4 )

now this would return whatever 1 number that was picked multiplied by 4 (e.g number picked = 5, the return would be 20)

another thing i tried (while extremely tedious) is printing the random number + random number

essentially what i want to do is make a 4 digit code e.g 3892




Aucun commentaire:

Enregistrer un commentaire