-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathallMyCats2new.py
More file actions
33 lines (23 loc) · 881 Bytes
/
allMyCats2new.py
File metadata and controls
33 lines (23 loc) · 881 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
#!/usr/bin/env python
import logging
logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(levelname)s- %(message)s')
logging.debug('Start of program')
def allCatNames():
catNames=[]
# Notice to keep things going, using a Loop
while True:
print('Enter the name of cat ' + str(len(catNames)+1) + #Converting to a string to concatenate and print a number
' (Or enter nothing to stop.):')
name=input()
if name == '':
break
catNames=catNames+[name] #list concatenation
print('The cat names are:')
# Again to keep things going, using a For Loop to move thru a list
for name in catNames:
print(' '+ name) #The space indents the printed list
def main():
allCatNames()
if __name__ == '__main__':
main()
logging.debug('End of program')