-
Notifications
You must be signed in to change notification settings - Fork 39
/
guess the movie.py
80 lines (64 loc) · 2.3 KB
/
guess the movie.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import random
list=["LAGAAN","ANAND","3IDIOTS","DANGAL","SWADES","AWEDNESDAY","UDAAN","SPECIAL26","SULTAN","HAIDER","QUEEN","BARFI","GURU","SARKAR","DRISHYAM","BABY","PK","AIRLIFT","HOLIDAY","GOODNEWWZ","KAHANI","BLACK","GOLMAAL","CHUPKECHUPKE","SHOLAY","DEEWAR","KESHARI","SHAHENSHAH","SHARABI","COOLIE","WAZIR","MANJHI","DON","ANDHADUN","PINK","LOOTERA","BADLA","AGNEEPATH","HUM","NEERJA","THELUNCHBOX","VEERZARA","MSDHONI","MANN","DIL","DHADKAN","ISHQ","KHILADI","ANARI","BADSHAH","BAZIGAR"]
#print(len(list))
movie=random.choice(list)
#print(movie)
n=(len(movie))
f=0
k=0
arr=[]
for i in range(0,n):
arr.append("_")
print("The rule of the game is:")
print("You have got 7 trials to enter the movie name .")
print("If u cant guess the name, then you can simply enter a letter.")
print()
for i in range(0,n):
print(arr[i]," ",end="")
tr=1
while(tr<=7):
print("Guess the movie if u can else enter a letter!")
inp=input()
print()
if(len(inp)==n or arr==movie):
if(inp == movie):
print("Hurray! You won. Yes the answer was",movie)
f=1
break
else:
print("Sorry,thats not right.")
print("You still have",7-tr," turns left.Try again.")
print()
for i in range(0,n):
print(arr[i]," ",end="")
print()
inp=input()
tr=tr+1
continue
elif(len(inp)==1):
for i in range(0,n):
c=movie[i]
if(inp==c):
arr[i]=c
k=1
for i in range(0,n):
print(arr[i]," ",end="")
print()
if(k==1):
print("Yes ",inp," is presnt in d movie name")
print("You still have",7-tr," turns left.Try again.",end=" ")
print("Keep going")
else:
print("Sorry",inp," is not there.")
print("You still have",7-tr," turns left.Try again.")
k=0
tr=tr+1
continue
print("Sorry,thats not right. Try again.")
print("You still have",7-tr," turns left.Try again.")
print()
inp=input()
tr=tr+1
print()
if f!=1:
print("Sorry,the answer was",movie)