Apr-05-2019, 12:49 PM
I want to write generator, which will be change the first letter of the names from list. I have to use "for" and "yield". I thought about something like that:
def names(lis): for i in lis: yield i.capitalizate() for Names in names(['john','tom','bruce']): print(Names)But I don't have idea hot to improve this code.