- Joined
- Dec 12, 2022
- Messages
- 8
- Reaction score
- 0
The assignment is "consider a company that creates 3D printed models of designs that users submit. Designs that need to be printed are stored in a list, and after being printed they're moved to a separate list."
Here is my code:
It's saying that at the end "completed_model" is not defined. Was it supposed to be? I thought that for a for loop you could just make up any variable for the first part.
Any help would be appreciated. Thanks in advance
Here is my code:
Python:
# Start with some designs that need to be printed
unprinted_designs = ['phone case', 'robot pendant', 'dodecahedron']
completed_models = []
# Simulate printing each design, until none are left
# Move each design to completed_models after printing
while unprinted_designs:
current_design = unprinted_designs.pop()
print(f"Printing model {current_design}")
completed_models.append(current_design)
# Display all completed models
print("\nThe following models have been printed:")
for compeleted_model in completed_models:
print(completed_model)
It's saying that at the end "completed_model" is not defined. Was it supposed to be? I thought that for a for loop you could just make up any variable for the first part.
Any help would be appreciated. Thanks in advance