1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
import csv import sys import random def main(): menu() def menu(): print ( " :::::::: ::: ::: :::::::::: :::::::: :::::::: " ) print ( " :+: :+: :+: :+: :+: :+: :+: :+: :+: " ) print ( " +:+ +:+ +:+ +:+ +:+ +:+ " ) print ( " :#: +#+ +:+ +#++:++# +#++:++#++ +#++:++#++ " ) print ( " +#+ +#+# +#+ +#+ +#+ +#+ +#+ " ) print ( " #+# #+# #+# #+# #+# #+# #+# #+# #+# " ) print ( " ######## ######## ########## ######## ######## " ) choice = input ( """ A: Play Q: Quit Please enter your choice: """ ) if choice = = "A" or choice = = "a" : print ( "Im thinking of a number between 1-10" ) chances = 3 secret = random.randint( 1 , 10 ) life = "true" while life = = "true" : guess = int ( input ( "Please enter your guess : " )) chances = chances - 1 if guess = = secret: print ( "Correct!" ) life = "false" else : if secret > guess: print ( "Higher" ) elif secret < guess: print ( "Lower" ) if chances = = 0 : print ( "Unlucky" "You have ran out of chances! The secret number was" ,secret) life = "false" main() |
