0
0
Software Engineeringknowledge~30 mins

Software engineering principles - Mini Project: Build & Apply

Choose your learning style9 modes available
Understanding Software Engineering Principles
📖 Scenario: You are part of a small software team building a simple app. To keep your work organized and efficient, you need to understand some basic software engineering principles.
🎯 Goal: Build a simple list of key software engineering principles with their brief descriptions to help your team remember and apply them.
📋 What You'll Learn
Create a dictionary called principles with exact principle names as keys and their descriptions as values.
Add a variable called min_length to set the minimum length of principle descriptions to consider.
Use a dictionary comprehension to create a new dictionary filtered_principles containing only principles with descriptions longer than min_length.
Add a final key-value pair to filtered_principles to include a summary principle.
💡 Why This Matters
🌍 Real World
Software engineers use principles like modularity and encapsulation to build reliable and maintainable software systems.
💼 Career
Understanding and applying software engineering principles is essential for writing clean code, collaborating in teams, and managing complex projects.
Progress0 / 4 steps
1
Create the initial principles dictionary
Create a dictionary called principles with these exact entries: 'Modularity' with description 'Divide the system into separate components.', 'Encapsulation' with description 'Hide internal details and expose only necessary parts.', and 'DRY' with description 'Don\'t Repeat Yourself - avoid code duplication.'.
Software Engineering
Need a hint?

Use curly braces to create a dictionary with keys and values as strings.

2
Add a minimum description length variable
Add a variable called min_length and set it to 30 to filter principles by description length.
Software Engineering
Need a hint?

Set min_length to 30 using a simple assignment.

3
Filter principles by description length
Use a dictionary comprehension to create a new dictionary called filtered_principles that includes only those entries from principles where the description length is greater than min_length.
Software Engineering
Need a hint?

Use {key: desc for key, desc in principles.items() if len(desc) > min_length} to filter.

4
Add a summary principle to filtered dictionary
Add a new key-value pair to filtered_principles with key 'Summary' and value 'Apply principles to write clean and maintainable code.'.
Software Engineering
Need a hint?

Use filtered_principles['Summary'] = 'Apply principles to write clean and maintainable code.' to add the new entry.