Oct-26-2019, 10:19 AM
(Oct-25-2019, 03:11 PM)Larz60+ Wrote: change line 3 from
name.title()To
name = name.title()
names=[['peter','jack','bo'],'eva',['christian','joanne',7],'5'] #Make all names in nested loop above with capital first letters, dont make new list but change current list #elements 7 and '5' should be left as is for list in names: for name in list: name = name.title() print(name) print(names)that does seem to make all but "eva" capital letters and prints: AttributeError: 'int' object has no attribute 'title'
which is probably as the list includes 7
furthermore, I cant print the list afterward. I don't think this for loop actually changes values within the names list?