Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- answer = 'banana'
- show = ''
- for l in answer:
- show+='_'
- madeguess = ''
- print(show)
- print()
- turns = 10
- while turns > 0:
- print('round ',11-turns)
- guess = input('enter your guess')
- if guess in madeguess:
- print('already guessed')
- else:
- if guess in answer:
- print('your guess is correct')
- madeguess += guess
- else:
- turns -= 1
- if turns == 9:
- print("9 turns left")
- print(" -------- ")
- elif turns == 8:
- print("8 turns left")
- print(" -------- ")
- print(" O ")
- elif turns == 7:
- print("7 turns left")
- print(" -------- ")
- print(" O ")
- print(" | ")
- elif turns == 6:
- print("6 turns left")
- print(" -------- ")
- print(" O ")
- print(" | ")
- print(" / ")
- elif turns == 5:
- print("5 turns left")
- print(" -------- ")
- print(" O ")
- print(" | ")
- print(" / \ ")
- elif turns == 4:
- print("4 turns left")
- print(" -------- ")
- print(" \ O ")
- print(" | ")
- print(" / \ ")
- elif turns == 3:
- print("3 turns left")
- print(" -------- ")
- print(" \ O / ")
- print(" | ")
- print(" / \ ")
- elif turns == 2:
- print("2 turns left")
- print(" -------- ")
- print(" \ O /| ")
- print(" | ")
- print(" / \ ")
- elif turns == 1:
- print("1 turn left")
- print("Last breaths counting, Take care!")
- print(" -------- ")
- print(" \ O_|/ ")
- print(" | ")
- print(" / \ ")
- elif turns == 0:
- print("You lose!")
- print("You let the man die :(")
- print(" -------- ")
- print(" O_| ")
- print(" /|\ ")
- print(" / \ ")
- break
- show=''
- for l in answer:
- if l in madeguess:
- show += l
- else:
- show += '_'
- print(show)
- if not '_' in show:
- print('You win')
- exit()
- print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement