-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathHangman_Game.py
34 lines (32 loc) · 1.11 KB
/
Hangman_Game.py
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
print("\n\t\t\tProgram to build the Hangman game")
print("\n\t\t\t\t\t\t\t---------WELCOME TO HANGMAN----------\n")
print("Guess the blank spaces to complete the given paragraph")
para="On a spring day,Saba and I went to the park.Once we got to the park, the sky turned Black.It started rain."
print("On a spring day,--- and I went to the park.Once we got to the park, the sky turned ----.It started ----\n")
#list of correct words
words=["Saba","Black","rain"]
lst=[]
guess=""
guess_limit=10
guess_count=0
guesses_over=False
while guess_count<guess_limit:
guess=input("HINT:Enter the name of person:")
lst.append(guess)
guess=input("HINT:Enter the color:")
lst.append(guess)
guess=input("HINT:Enter noun:")
lst.append(guess)
if lst==words:
guesses_over=True
break
else:
lst.clear()
print("\n")
guess_count +=1
if guesses_over:
print("Congrats! You have won.")
print("\nThe complete paragraph is:")
print("On a spring day,Saba and I went to the park.Once we got to the park, the sky turned Black.It started rain.")
else:
print("OOPS! Game Over.")