📖 Scenario: You are learning about modern car safety features that help drivers avoid accidents and drive more safely. These features are part of Advanced Driver Assistance Systems (ADAS).Imagine you are creating a simple list of common ADAS features and their descriptions to help new drivers understand what each feature does.
🎯 Goal: Build a structured list of ADAS features with their names and simple descriptions to explain their purpose clearly.
📋 What You'll Learn
Create a dictionary called adas_features with exact feature names as keys and their descriptions as values.
Add a variable called minimum_safety_rating set to 4 to represent the minimum safety rating for ADAS features.
Use a loop with variables feature and description to iterate over adas_features.items() and create a new dictionary high_rating_features that includes only features with a rating equal or above minimum_safety_rating.
Add a final dictionary called adas_ratings with exact ratings for each feature to complete the ADAS overview.
💡 Why This Matters
🌍 Real World
ADAS features are common in modern vehicles to improve safety and assist drivers in everyday driving situations.
💼 Career
Understanding ADAS is important for automotive technicians, safety engineers, and anyone working in vehicle technology or driver education.
Progress0 / 4 steps
1
Create the ADAS features dictionary
Create a dictionary called adas_features with these exact entries: 'Adaptive Cruise Control' with description 'Maintains a set speed and distance from the car ahead', 'Lane Departure Warning' with description 'Alerts when the vehicle drifts out of its lane', and 'Automatic Emergency Braking' with description 'Applies brakes automatically to avoid collision'.
EV Technology
Hint
Use curly braces {} to create a dictionary with keys and values as strings.
2
Add minimum safety rating variable
Add a variable called minimum_safety_rating and set it to the integer 4 to represent the minimum safety rating for ADAS features.
EV Technology
Hint
Use a simple assignment to create the variable with the value 4.
3
Filter features by safety rating
Use a for loop with variables feature and description to iterate over adas_features.items(). Inside the loop, create a new dictionary called high_rating_features that includes only features with a rating equal or above minimum_safety_rating. Assume you have a dictionary adas_ratings (to be added next) that holds ratings for each feature.
EV Technology
Hint
Use adas_ratings.get(feature, 0) to get the rating safely and compare it to minimum_safety_rating.
4
Add ADAS ratings dictionary
Add a dictionary called adas_ratings with these exact entries: 'Adaptive Cruise Control': 5, 'Lane Departure Warning': 3, and 'Automatic Emergency Braking': 5 to complete the ADAS overview.
EV Technology
Hint
Use curly braces {} to create the dictionary with exact keys and integer values.
Practice
(1/5)
1. What is the main purpose of ADAS (Advanced Driver Assistance Systems)?
easy
A. To help drivers stay safe and reduce accidents
B. To replace the driver completely
C. To increase the speed of the vehicle
D. To make the vehicle heavier
Solution
Step 1: Understand ADAS purpose
ADAS is designed to assist drivers by improving safety and reducing accidents.
Step 2: Evaluate options
Only To help drivers stay safe and reduce accidents correctly states the main purpose; others are incorrect or unrelated.
Final Answer:
To help drivers stay safe and reduce accidents -> Option A
Quick Check:
ADAS purpose = safety and accident reduction [OK]
Hint: ADAS helps drivers, not replaces them [OK]
Common Mistakes:
Thinking ADAS replaces the driver
Believing ADAS increases vehicle speed
Confusing ADAS with vehicle weight
2. Which of the following is a common feature of ADAS?
easy
A. Lane departure warning
B. Manual gear shifting
C. Radio tuning
D. Air conditioning control
Solution
Step 1: Identify ADAS features
Common ADAS features include lane departure warning, adaptive cruise control, and emergency braking.
Step 2: Match options to ADAS features
Only lane departure warning is an ADAS feature; others relate to non-safety vehicle functions.
Final Answer:
Lane departure warning -> Option A
Quick Check:
Lane warning = ADAS feature [OK]
Hint: ADAS features focus on safety, not comfort [OK]
Common Mistakes:
Confusing entertainment controls with ADAS
Selecting manual controls unrelated to assistance
Ignoring safety-related features
3. Consider this code snippet simulating an ADAS alert system:
alerts = ['lane_warning', 'speed_alert', 'brake_assist']
for alert in alerts:
if alert == 'speed_alert':
print('Slow down!')
else:
print('Check system')
What will be the output?
medium
A. Slow down!\nCheck system\nSlow down!
B. Slow down!\nSlow down!\nSlow down!
C. Check system\nSlow down!\nCheck system
D. Check system\nCheck system\nCheck system
Solution
Step 1: Analyze the loop and conditions
The loop goes through each alert. For 'speed_alert', it prints 'Slow down!'. For others, it prints 'Check system'.
Step 2: Determine output for each alert
First alert 'lane_warning' prints 'Check system'. Second 'speed_alert' prints 'Slow down!'. Third 'brake_assist' prints 'Check system'.
Final Answer:
Check system
Slow down!
Check system -> Option C
Quick Check:
Only 'speed_alert' triggers 'Slow down!' [OK]
Hint: Only 'speed_alert' prints 'Slow down!' [OK]
Common Mistakes:
Assuming all alerts print 'Slow down!'
Mixing order of outputs
Ignoring else condition
4. This code is meant to check if emergency braking is active:
status = {'emergency_braking': True, 'lane_assist': False}
if status['emergency_braking'] = True:
print('Emergency braking active')
else:
print('System normal')
What is the error in this code?
medium
A. Incorrect dictionary key name
B. Missing colon after if statement
C. Print statement syntax error
D. Using '=' instead of '==' in the if condition
Solution
Step 1: Identify syntax error in if condition
The code uses '=' which is assignment, not comparison. It should use '==' to compare values.
Step 2: Confirm other parts are correct
Dictionary keys and print statements are correct; colon is present after if.
Final Answer:
Using '=' instead of '==' in the if condition -> Option D
Quick Check:
Comparison needs '==' not '=' [OK]
Hint: Use '==' for comparison, '=' for assignment [OK]
Common Mistakes:
Confusing assignment and comparison operators
Overlooking correct dictionary keys
Assuming missing colon error
5. An ADAS system uses sensors to detect obstacles and automatically applies brakes if the driver does not react. Which two ADAS features are combined here?
hard
A. Adaptive cruise control and lane keeping assist
B. Emergency braking and obstacle detection
C. Blind spot monitoring and parking assist
D. Traffic sign recognition and speed alert
Solution
Step 1: Identify features from description
The system detects obstacles (obstacle detection) and applies brakes automatically (emergency braking).
Step 2: Match features to options
Emergency braking and obstacle detection correctly combines emergency braking and obstacle detection; others do not match the description.
Final Answer:
Emergency braking and obstacle detection -> Option B
Quick Check:
Obstacle detection + auto brake = emergency braking [OK]