Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Challenge 3
- import random
- def number_code(game):
- if game == "yes":
- n1 = random.randint(0,9)
- n2 = random.randint(0,9)
- n3 = random.randint(0,9)
- n4 = random.randint(0,9)
- n5 = random.randint(0,9)
- n6 = random.randint(0,9)
- print("Your pass code is : " + str(n1) + str(n2) + str(n3) + str(n4) + str(n5) + str(n6))
- return
- # loop
- finished = False
- while finished == False:
- game = input("Do you want to select a pass code?: yes/no: ")
- if game == "yes":
- number_code(game)
- else:
- print("Your answer has been... " + game + " , bye.")
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement