-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrhang.py
55 lines (45 loc) · 898 Bytes
/
rhang.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
import random
with open('foot.txt') as f:
words = list(f)
org=random.choice(words).strip()
new=[]
for i in range(len(org)):
new.append('_')
cw=0
bw=""
while (1):
f=0
aap=0
print("Enter a letter")
ch=input()
for i in range(len(bw)):
if ch[0]==bw[i]:
aap=1
if aap==1:
print("Already entered")
print()
continue
else:
bw=bw+ch
for i in range(len(org)):
if org[i]==ch[0]:
new[i]=ch[0]
f=1
if f!=1:
print("Not present")
cw+=1
if cw==5:
print("Game over")
break
print(new)
c=0
for i in range(len(org)):
if new[i]=='_':
c+=1
if c==0:
print()
print(org.upper())
print()
print("BINGO!!")
break
print()