-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprinting_models.py
More file actions
executable file
·27 lines (21 loc) · 869 Bytes
/
Copy pathprinting_models.py
File metadata and controls
executable file
·27 lines (21 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/python3
def print_models(unprinted_designs):
"""
Simulate printing each design, until none are left.
Move each design to completed_models after printing.
"""
completed_models = []
while unprinted_designs:
current_design = unprinted_designs.pop()
# Simulate creating a 3D print from the design.
print("Printing model: " + current_design)
completed_models.append(current_design)
return completed_models
def show_completed_models(completed_models):
"""Show all the models that were printed."""
print("\nThe following models have been printed:")
for completed_model in completed_models:
print(completed_model)
unprinted_designs = ['iphone case','robot pendant','dodecahedron']
completed_models = print_models(unprinted_designs)
show_completed_models(completed_models)