I am going through the book Automate the Boring Stuff with Python, and need help understanding what's really happening with the code.
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]
print('The cat names are:')
for name in catNames:
print(' ' + name)
now it makes sense until
for name in catNames:
print(' ' + name)
I am only used to seeing for loops with range(), and this does not make sense to me. A detailed explanation would be highly appreciated thanks