-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathName Matcher.py
More file actions
38 lines (30 loc) · 866 Bytes
/
Copy pathName Matcher.py
File metadata and controls
38 lines (30 loc) · 866 Bytes
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
def replay():
# type: () -> Boolean
"""
:return: This will return a Boolean Value for game play
"""
option = raw_input('Do you want to try again? (y/n)\nTo view all name press "a"').upper()
if option.startswith('Y'):
return True
elif option.startswith('A'):
print lists
return True
else:
return False
start = True
while start:
myFile = open('Name.txt')
lists = myFile.read().split()
myFile.close()
name = raw_input('Input your name: ')
for l in lists:
if l == name:
print 'Name Found!!'
break
else:
print 'Not Found!'
if raw_input('Do you wanna add the name?(y/n)').upper().startswith('Y'):
myFile1 = open('Name.txt', 'a')
myFile1.write(' ' + name)
myFile1.close()
start = replay()