Форум сайта python.su
fokuses =
def show_magicians(fokuses):
for name in fokuses:
print(name.title() + “ Hello”)
show_magicians(fokuses)
def make_greate(fokuses):
while fokuses:
k = fokuses.pop()
print(“\tGreat ” + k.title())
make_greate(fokuses)
____________________________________________>>>>>>>>>>>.>>>.
Vasya Hello
Dima Hello
Petya Hello
Great Petya
Great Dima
Great Vasya
Офлайн
def show_magicians(names): for name in names: print(f'Hello {name}!') magicians = 'Larry', 'Hank', 'Bruce' def make_great(names:list): name = f'{name} Great' for name in names return name show_magicians(make_great(magicians))
Отредактировано FishHook (Июнь 22, 2022 18:08:41)
Офлайн
petkazz
а вы это код запускать пробовали?
Офлайн
petkazz, добавь скобочки к своему творению
>>> def show_magicians(names): ... for name in names: ... print(f'Hello {name}!') ... >>> def make_great(names:list): ... name = (f'Great {name}' for name in names) ... return name ... >>> magicians = 'Larry', 'Hank', 'Bruce' >>> show_magicians(magicians) Hello Larry! Hello Hank! Hello Bruce! >>> show_magicians(make_great(magicians)) Hello Great Larry! Hello Great Hank! Hello Great Bruce! >>>
Отредактировано py.user.next (Июнь 22, 2022 21:06:40)
Офлайн