Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to set the flip axis to X for the second setup.
CNC Programming
setup2.flip_axis = '[1]'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Y' or 'Z' instead of 'X' for the flip axis.
Setting flip_axis to 'None' which disables flipping.
✗ Incorrect
The flip axis for the second setup should be set to 'X' to flip the part along the X axis.
2fill in blank
mediumComplete the code to rotate the part 180 degrees around the Z axis in the third setup.
CNC Programming
setup3.rotation_angle = [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 90 or 270 degrees which rotate the part partially.
Using 360 degrees which results in no change.
✗ Incorrect
Rotating 180 degrees around the Z axis flips the part upside down for the third setup.
3fill in blank
hardFix the error in the code to correctly apply the flip operation on the first setup.
CNC Programming
setup1.apply_flip([1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the flip axis as a string instead of a variable.
Using incorrect variable names like flip_axis_value or flipAxis.
✗ Incorrect
The method apply_flip expects the variable flip_axis, not a string or incorrect variable name.
4fill in blank
hardFill both blanks to create a dictionary mapping setup numbers to their flip axes.
CNC Programming
flip_map = {1: '[1]', 2: '[2]'} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the axes for setups 1 and 2.
Using 'None' which means no flip.
✗ Incorrect
Setup 1 flips on X axis and setup 2 flips on Y axis, so the dictionary maps 1 to 'X' and 2 to 'Y'.
5fill in blank
hardComplete the code to create a dictionary comprehension that maps setup numbers to their rotation angles if the angle is greater than 0.
CNC Programming
rotation_angles = {setup: angle for setup, angle in setups.items() if angle [1] 0} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Adding unnecessary characters after keys or values.
Using '<' which filters angles less than zero.
✗ Incorrect
No extra characters are needed after 'setup' or 'angle' keys, and the condition filters angles greater than 0 using '>'.