mardi 12 décembre 2017

Python 3: How to use a random number generator code to be used as a password for a door

I am making a text adventure game in Python 3 and I am trying to use a random code found in one part of the game and used as a password for the final part of the game but I don't know how to make the random generated code the password. I have the random number generator. How do I make the number that is generated the password.

import random
def code():
     numbers = random.sample(range(10), 4)
     print(''.join(map(str, numbers)))




Aucun commentaire:

Enregistrer un commentaire