Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.02 KB | None | 0 0
  1. def print_models(unprinted_designs, completed_models):
  2.     '''
  3.    Имитирует печать моделей, пока список не станет пустым.
  4.    Каждая модель после печати перемещается в completed_models.
  5.    '''
  6.    
  7.     while unprinted_designs:
  8.         current_design = unprinted_designs.pop()
  9.         # Имитация печати модели на 3D-принтере.
  10.         print('Printing model: ' + current_design)
  11.         completed_models.append(current_design)
  12.  
  13. def show_completed_models(completed_models):
  14.     '''Выводит информацию обо всех напечатанных моделях.'''
  15.     print('\nThe following models have been printed:')
  16.     for completed_model in completed_models:
  17.         print(completed_model)
  18.  
  19. unprinted_designs = ['iphone case', 'robot pendant', 'dodecahedron']
  20. completed_models = []
  21. print_models(unprinted_designs[:], completed_models)
  22. show_completed_models(completed_models)
  23. print(unprinted_designs)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement