File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ print ('Enter the name of cat 1:' )
2
+ catName1 = input ()
3
+ print ('Enter the name of cat 2:' )
4
+ catName2 = input ()
5
+ print ('Enter the name of cat 3:' )
6
+ catName3 = input ()
7
+ print ('Enter the name of cat 4:' )
8
+ catName4 = input ()
9
+ print ('Enter the name of cat 5:' )
10
+ catName5 = input ()
11
+ print ('Enter the name of cat 6:' )
12
+ catName6 = input ()
13
+ print ('The cat names are:' )
14
+ print (catName1 + ' ' + catName2 + ' ' + catName3 + ' ' + catName4 + ' ' + catName5 + ' ' + catName6 )
Original file line number Diff line number Diff line change
1
+ catNames = []
2
+ while True :
3
+ print ('Enter the name of cat ' + str (len (catNames ) + 1 ) +
4
+ ' (or enter nothing to stop.):' )
5
+ name = input ()
6
+ if name == '' :
7
+ break
8
+ catNames = catNames + [name ] # list concatenation
9
+ print ('The cat names are:' )
10
+ for name in catNames :
11
+ print (' ' + name )
You can’t perform that action at this time.
0 commit comments