ADM Python Practice • Practice 2

Part Inspection & Routing Logic

Write decision logic that determines whether a part passes inspection and where it should be routed.

Practice Assignment

What You Need to Do

  1. Create variables for part_height, minimum_height, maximum_height, and destination.
  2. Create a Boolean expression that determines whether the part height is acceptable.
  3. If the part is acceptable, route destination 1 to Pallet 1 and destination 2 to Pallet 2.
  4. If the destination is invalid, print an error message.
  5. If the part fails inspection, route it to a reject location instead of a pallet.
Browser Python Lab

Build and Test Your Program

Modify the starter code until all required behaviors work. No physical Workcell is needed.

Interactive Python Practice

Part Inspection & Routing Logic

Ready
Editable Python Code
Output & Errors
Predict what will happen, then click Run Code.

Tip: Press Ctrl+Enter (Cmd+Enter on Mac) to run. The mock arm prints simulated Workcell actions instead of controlling hardware.

Success Criteria

Check Your Work

  • A part below 45 or above 50 is rejected.
  • A valid part with destination 1 reaches Pallet 1.
  • A valid part with destination 2 reaches Pallet 2.
  • An invalid destination produces a clear error message.
Submission

What to Turn In

  • Your final Python code copied into the assignment submission.
  • A screenshot of the final output showing that the program ran successfully.
  • One debugging note: identify one problem you encountered and explain how you fixed it.