Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to start a loop that repeats 5 times.
CNC Programming
FOR [1] = 1 TO 5
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name that is not allowed or not initialized.
Using a keyword instead of a variable name.
✗ Incorrect
The variable X is commonly used as the loop counter in CNC programming loops.
2fill in blank
mediumComplete the code to increment the loop counter by 1.
CNC Programming
[1] = [1] + 1
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names on each side.
Forgetting to increment the counter.
✗ Incorrect
The loop counter variable X is incremented by 1 each loop to count iterations.
3fill in blank
hardFix the error in the loop condition to stop after 10 cuts.
CNC Programming
WHILE [1] <= 10
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable not updated in the loop.
Using a variable that is not the loop counter.
✗ Incorrect
The loop counter X is used in the condition to repeat the loop 10 times.
4fill in blank
hardFill both blanks to create a loop that repeats while the counter is less than 8 and increments by 1.
CNC Programming
WHILE [1] < 8 [2] = [2] + 1
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variables for condition and increment.
Using a variable not initialized.
✗ Incorrect
The variable X is used as the loop counter in both the condition and increment.
5fill in blank
hardFill all three blanks to create a dictionary of cut depths for each pass where depth increases by 0.5 each time and only depths greater than 1.0 are included.
CNC Programming
cut_depths = [1]: [2] * 0.5 for [1] in range(1, 6) if [2] > 1.0}}
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names inconsistently.
Not matching the variable names in the comprehension.
✗ Incorrect
The dictionary comprehension uses pass_num as key and value calculation, filtering depths greater than 1.0.
