Форум сайта python.su
Здравствуйте, может кто то откоммментировать построчно код? Спасибо!
def print_models(unprinted_designs, completed_models):
while unprinted_designs:
current_design = unprinted_designs.pop()
print(f“Printing model: {current_design}”)
completed_models.append(current_design)
def show_completed_models(completed_models):
print(“\nThe following models have been printed:”)
for completed_model in completed_models:
print(completed_model)
unprinted_designs =
completed_models =
print_models(unprinted_designs, completed_models)
show_completed_models(completed_models)
Офлайн
def print_models(unprinted_designs, completed_models): # 1 строка # 2 строка while unprinted_designs: # 3 строка current_design = unprinted_designs.pop() # 4 строка print(f“Printing model: {current_design}”) # 5 строка completed_models.append(current_design) # 6 строка # 7 строка def show_completed_models(completed_models): # 8 строка print(“\nThe following models have been printed:”) # 9 строка for completed_model in completed_models: # 10 строка print(completed_model) # 11 строка # 12 строка unprinted_designs = # 13 строка completed_models = # 14 строка # 15 строка print_models(unprinted_designs, completed_models) # 16 строка show_completed_models(completed_models) # 17 строка
Офлайн
AD0DE412Спасибо
Офлайн
Там происходит магия
Вот расшифровка кодов
https://www.pdfdrive.com/%D0%98%D0%B7%D1%83%D1%87%D0%B0%D0%B5%D0%BC-python-4-%D0%B5-%D0%B8%D0%B7%D0%B4%D0%B0%D0%BD%D0%B8%D0%B5-e186454941.html
Офлайн