0
0
CNC Programmingscripting~10 mins

Surface finish standards (Ra) in CNC Programming - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the surface roughness value to 1.6 micrometers.

CNC Programming
surface_roughness = [1]  # Ra value in micrometers
Drag options to blanks, or click blank then click option'
A6
B16
C0.16
D1.6
Attempts:
3 left
💡 Hint
Common Mistakes
Using a value too large like 16 which is not typical for Ra.
Using a value too small like 0.16 without context.
2fill in blank
medium

Complete the code to calculate the average surface roughness from a list of Ra measurements.

CNC Programming
average_ra = sum(ra_values) / [1]
Drag options to blanks, or click blank then click option'
Alen(ra_values)
Bmax(ra_values)
Cmin(ra_values)
Dra_values[0]
Attempts:
3 left
💡 Hint
Common Mistakes
Dividing by max or min values instead of count.
Using an element instead of the length of the list.
3fill in blank
hard

Fix the error in the code to compare if the Ra value is less than the maximum allowed roughness.

CNC Programming
if ra_value [1] max_roughness:
    print('Surface finish is acceptable')
Drag options to blanks, or click blank then click option'
A>
B<
C==
D>=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' which checks if roughness is greater, meaning worse finish.
Using '==' which only checks equality.
4fill in blank
hard

Fill both blanks to create a dictionary of parts with their Ra values filtered by a maximum roughness.

CNC Programming
filtered_parts = {part: ra for part, ra in parts_ra.items() if ra [1] [2]
Drag options to blanks, or click blank then click option'
A<
B>
Cmax_roughness
Dmin_roughness
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' instead of '<' which would filter the wrong parts.
Using min_roughness instead of max_roughness.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that converts Ra values from micrometers to nanometers for parts with Ra less than max_roughness.

CNC Programming
converted_ra = { [1]: ra * [2] for [3], ra in parts_ra.items() if ra < max_roughness }
Drag options to blanks, or click blank then click option'
Apart
B1000
Dra
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ra' as key instead of 'part'.
Multiplying by wrong factor or variable.
Swapping variable names in the loop.