Learning Targets
- Read Python from top to bottom
- Identify comments and method calls
- Predict the order of Workcell actions
Program order, comments, method calls, and predicting robot behavior.
Read Python from top to bottom Identify comments and method calls Predict the order of Workcell actions
For the online work: a browser and your engineering notebook. Follow the activity’s materials list for any physical build, and get teacher approval before using equipment.
Suggested work block: 45–60 minutes. Physical builds and projects may span several classes; follow your teacher’s schedule.
Python normally executes one line at a time from top to bottom. A line beginning with # is a comment for humans; it does not command the robot.
A command such as arm.move_to(100, 150, 120) calls a method on the configured arm. The numbers are arguments that tell the method where to move.
Trace the commands in order and translate each line into the physical action it would represent.
Read every line and predict what the program would do before opening the practice check.
# Move above the pickup point
arm.move_to(100, 150, 120)
# Move down to the part
arm.move_to(100, 150, 45)
# Pick up the part
arm.set_end_effector_magnet(True)
# Lift the part
arm.move_to(100, 150, 120)Rule: If you missed more than one question, reread Learn It and trace the example again before continuing.
Number the four robot actions in the order they occur. What would change if the final movement command were deleted?
Do first: Write your answer in your engineering notebook.
The arm moves above the part, lowers, turns on the magnet, then lifts. Without the last movement command, the arm would remain at the pickup height after the magnet turns on.
Find and correct every error before opening the answer.
arm.move_to(100, 150, 120)
arm.set_end_effector_magnet(True
arm.move_to(100, 150, 45)Add the missing closing parenthesis. Also consider sequence: if the intent is to pick up the part, the arm should normally lower before activating the magnet.
Change the program so the arm moves above the part, lowers to the part, turns the magnet on, and then lifts the part.
Evidence: Paste the revised code into your engineering notebook.
Write a short Workcell sequence that moves to a safe point, approaches a pickup point, activates the magnet, and returns to the safe point.
Edit the code, predict the output, then click Run Code. No physical Workcell is connected.
Predict what the code will do, then click Run Code.
Tip: Press Ctrl+Enter (Cmd+Enter on Mac) to run. The mock arm object prints simulated Workcell actions instead of controlling hardware.
Without looking back at Learn It, answer these in your notebook:
A strong response names the Python idea accurately, connects it to a specific Workcell action or decision, and identifies a realistic syntax or logic error from this lesson.
Move on only when you can check every statement. If one is still uncertain, revisit the worked example or redo Fix It before continuing.
Use the official VEX API only as a programming reference to verify method names and parameters. The examples use the configured arm name arm. No physical Workcell is required.
Submit the evidence specified in the activity and your classroom assignment. The report below collects your notes, calculations, observations, and reflections; attach any required drawings, photos, CAD, or code separately.
A PDF download is not a submission. Review it, then upload it and any required attachments through your classroom assignment system.