I am following an exercise on the book how to automate the boring stuff and I was wondering what is the purpose of the str(len(catNames) on line 3, will it just add a number after user inputs data e.g. Enter the name of cat 2,3 etc? Thanks in advance!
catNames = []
while True:
print('Enter the name of cat ' + str(len(catNames) + 1) + ' (Or enter nothing to stop.):')
name = input()
if name == '':
break
catNames = catNames + [name] # list concatenation
print('The cat names are:')
for name in catNames:
print(' ' + name)