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)))