Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to start the loop for drilling 5 holes.
CNC Programming
FOR [1] = 1 TO 5 DRILL HOLE NEXT [1]
Attempts:
3 left
💡 Hint
Common Mistakes
Using axis names like X or Y as loop variables.
Using variables not declared or not typical for loops.
✗ Incorrect
The loop variable is commonly named I in CNC programming loops.
2fill in blank
mediumComplete the code to move the drill 10 units right after each hole.
CNC Programming
FOR I = 1 TO 5 DRILL HOLE MOVE X [1] NEXT I
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong distances like 5 or 15 which changes hole spacing.
Forgetting to move the drill after drilling.
✗ Incorrect
Moving 10 units right after each hole spaces the holes evenly.
3fill in blank
hardFix the error in the loop to drill holes along Y axis instead of X.
CNC Programming
FOR I = 1 TO 5 DRILL HOLE MOVE [1] 10 NEXT I
Attempts:
3 left
💡 Hint
Common Mistakes
Using X axis moves when holes should be along Y.
Using loop variable I as axis which is invalid.
✗ Incorrect
To drill holes along the Y axis, move the drill 10 units on Y each loop.
4fill in blank
hardFill both blanks to create a nested loop drilling a 3x3 grid of holes.
CNC Programming
FOR [1] = 1 TO 3 FOR [2] = 1 TO 3 DRILL HOLE MOVE X 10 NEXT [2] MOVE Y 10 NEXT [1]
Attempts:
3 left
💡 Hint
Common Mistakes
Using same variable for both loops causing errors.
Using axis names like X or Y as loop variables.
✗ Incorrect
Outer loop uses I for Y axis rows, inner loop uses J for X axis columns.
5fill in blank
hardFill all three blanks to create a dictionary of hole positions with conditions.
CNC Programming
positions = { [1]: [2] for [3] in range(1, 4) if [3] % 2 == 1 }Attempts:
3 left
💡 Hint
Common Mistakes
Mixing keys and values in dictionary comprehension.
Using wrong variable names causing syntax errors.
✗ Incorrect
Use x as loop variable, x*10 as position, and x as key for odd positions.
