Bird
0
0
CNC Programmingscripting~15 mins

CNC vs manual machining in CNC Programming - Hands-On Comparison

Choose your learning style9 modes available
Understanding CNC vs Manual Machining
📖 Scenario: You work in a workshop where both CNC machines and manual machines are used. You want to create a simple program that helps you compare the two methods by listing their key features and differences.
🎯 Goal: Build a small program that stores features of CNC machining and manual machining, then filters and displays the differences clearly.
📋 What You'll Learn
Create a dictionary called machining_methods with keys 'CNC' and 'Manual' and their feature lists as values
Create a variable called filter_keyword to select features containing a specific word
Use a dictionary comprehension to create a new dictionary filtered_features that only includes features containing filter_keyword
Print the filtered_features dictionary to show the filtered results
💡 Why This Matters
🌍 Real World
This project helps beginners understand how to organize and filter data about machining methods, a common task in manufacturing and engineering.
💼 Career
Knowing how to handle and filter data about CNC and manual machining is useful for roles in manufacturing, production planning, and CNC programming.
Progress0 / 4 steps
1
Create the machining methods data
Create a dictionary called machining_methods with these exact entries:
'CNC' mapped to the list ["Automated", "High precision", "Requires programming", "Expensive setup"] and 'Manual' mapped to the list ["Hand operated", "Lower precision", "No programming needed", "Lower cost"].
CNC Programming
Hint

Use curly braces {} to create a dictionary. Use square brackets [] for lists.

2
Add a filter keyword
Create a variable called filter_keyword and set it to the string "precision".
CNC Programming
Hint

Assign the string "precision" to the variable filter_keyword.

3
Filter features by keyword
Use a dictionary comprehension to create a new dictionary called filtered_features. It should include the same keys as machining_methods, but only the features that contain the filter_keyword string (case sensitive).
CNC Programming
Hint

Use {key: [item for item in list if condition] for key, list in dict.items()} pattern.

4
Display the filtered features
Print the filtered_features dictionary to show the filtered features for CNC and Manual machining.
CNC Programming
Hint

Use print(filtered_features) to display the dictionary.