📖 Scenario: You are planning a trip with an electric vehicle (EV). To avoid running out of battery, you want to plan your route carefully. You have a list of charging stations along your path, each with a known distance from your starting point.Your goal is to select only the charging stations that are within your EV's current range so you can recharge without running out of power.
🎯 Goal: Build a simple route plan that lists only the charging stations reachable within the EV's current battery range.
📋 What You'll Learn
Create a dictionary of charging stations with their distances in kilometers.
Set a variable for the EV's current maximum range in kilometers.
Filter the charging stations to include only those within the EV's range.
Complete the route plan by listing the reachable stations.
💡 Why This Matters
🌍 Real World
Planning EV trips efficiently to avoid running out of battery by selecting reachable charging stations.
💼 Career
Useful for roles in electric vehicle fleet management, route optimization, and sustainable transportation planning.
Progress0 / 4 steps
1
Create the charging stations data
Create a dictionary called charging_stations with these exact entries: 'Station A': 15, 'Station B': 40, 'Station C': 60, 'Station D': 85, 'Station E': 120. The numbers represent the distance in kilometers from your starting point.
EV Technology
Hint
Use curly braces {} to create a dictionary with station names as keys and distances as values.
2
Set the EV's current range
Create a variable called ev_range and set it to 70 to represent the EV's current maximum driving range in kilometers.
EV Technology
Hint
Use a simple assignment statement to set the EV range.
3
Filter reachable charging stations
Create a new dictionary called reachable_stations that includes only the stations from charging_stations where the distance is less than or equal to ev_range. Use a dictionary comprehension with for station, distance in charging_stations.items() and a condition to filter.
EV Technology
Hint
Use a dictionary comprehension with an if condition to filter stations by distance.
4
Complete the route plan
Add a variable called route_plan and set it to a list of the keys from reachable_stations to list the names of reachable charging stations in order.
EV Technology
Hint
Use the keys() method on the dictionary and convert it to a list.
Practice
(1/5)
1. What is the main purpose of route planning in electric vehicles (EVs)?
easy
A. To avoid running out of battery during trips
B. To increase the speed of the vehicle
C. To reduce tire wear
D. To improve air conditioning efficiency
Solution
Step 1: Understand the goal of route planning
Route planning in EVs focuses on managing battery usage and charging stops.
Step 2: Identify the main benefit
The key benefit is to avoid running out of battery, ensuring the vehicle can complete the trip safely.
Final Answer:
To avoid running out of battery during trips -> Option A
Quick Check:
Route planning = avoid battery drain [OK]
Hint: Focus on battery management as the main goal [OK]
Common Mistakes:
Confusing route planning with speed optimization
Thinking it improves tire or AC efficiency
Ignoring battery level importance
2. Which of the following is a key factor used in EV route planning for range optimization?
easy
A. Number of passengers
B. Color of the vehicle
C. Current battery level
D. Type of tires
Solution
Step 1: Identify important inputs for route planning
Route planning depends on factors affecting battery usage, such as current battery level.
Step 2: Eliminate unrelated options
Vehicle color, passengers, and tire type do not directly affect battery range calculation.
Final Answer:
Current battery level -> Option C
Quick Check:
Battery level = key factor [OK]
Hint: Battery level is always crucial for range planning [OK]
Common Mistakes:
Choosing unrelated vehicle features
Ignoring battery status
Confusing passenger count with energy use
3. An EV has 40% battery left and needs to travel 100 km. The vehicle efficiency is 5 km per 1% battery. Which statement is true about the route planning?
medium
A. The EV needs to charge at least once before reaching.
B. The EV can reach the destination without charging.
C. The EV's battery is enough for 40 km.
D. The EV should reduce speed to save battery.
Solution
Step 1: Calculate maximum distance possible with current battery
Battery left = 40%, efficiency = 5 km/% so max distance = 40 * 5 = 200 km.
Step 2: Compare max distance with trip distance
100 km trip less than 200 km range, so the EV can reach without charging.
Step 3: Eliminate distractors
Needing to charge is false; 40 km range forgets efficiency; speed reduction not required by calculation.
Final Answer:
The EV can reach the destination without charging. -> Option B
Quick Check:
40% * 5 km/% = 200 km > 100 km [OK]
Hint: Multiply battery % by efficiency to check range [OK]
Common Mistakes:
Mixing up battery percentage and distance
Ignoring vehicle efficiency
Assuming charging is always needed
4. A route planner suggests a path with charging stations every 50 km, but the EV can only travel 40 km on a full charge. What is the main issue?
medium
A. Charging stations are too far apart for the EV's range.
B. The EV's battery is overcharged.
C. The route planner ignored traffic conditions.
D. The EV's speed is too slow.
Solution
Step 1: Compare EV range with charging station distance
EV range is 40 km, but stations are 50 km apart, so EV cannot reach next station on full charge.
Step 2: Identify the problem in route planning
The planner failed to consider the EV's maximum range, causing a gap too large to cross safely.
Final Answer:
Charging stations are too far apart for the EV's range. -> Option A
Quick Check:
Station gap > EV range = problem [OK]
Hint: Check if station distance exceeds EV range [OK]
Common Mistakes:
Blaming battery overcharge incorrectly
Ignoring station distances
Focusing on speed or traffic instead
5. You plan a 300 km trip with an EV that has a 150 km range per full charge. Charging stations are located at 100 km and 220 km along the route. What is the best charging strategy to optimize your trip time?
hard
A. Skip charging at 100 km and charge fully at 220 km.
B. Charge fully at 100 km and skip charging at 220 km.
C. Charge partially at 100 km and fully at 220 km.
D. Charge fully at 100 km, then partially at 220 km to reach destination.
Solution
Step 1: Analyze EV range and station positions
EV range is 150 km. From start to 100 km station is within range. From 100 km to 220 km is 120 km, within range. From 220 km to 300 km is 80 km, within range.
Step 2: Plan charging stops to minimize time
Charging fully at 100 km ensures enough range to reach 220 km station. Partial charge at 220 km is enough to reach destination (80 km). Skipping 100 km charging risks running out before 220 km.
Final Answer:
Charge fully at 100 km, then partially at 220 km to reach destination. -> Option D
Quick Check:
Full + partial charges cover trip efficiently [OK]
Hint: Charge fully early, partial later to save time [OK]
Common Mistakes:
Skipping early charging stop
Charging fully twice unnecessarily
Ignoring station distances and EV range
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.