Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider that you work for the Department of Transportation and they are trying to determine the difference between the fastest car and the slowest car
- Consider that you work for the Department of Transportation and they are trying to determine the difference between the fastest car and the slowest car that passed by a particular spot on the highway during a specific time. A sensor has been placed at a certain spot, and it will collect the speed of all cars that pass the spot. Write a python program that does the following:
-
- Gets the number of cars that passed the sensor during the specified time.
- Gets the data (the list of speeds) from the user and stores it in a list.
- Prints the difference between the fastest car and the slowest car during that time period.
Need help constructing the code on this one.
Python 3.7.0 Shell Python 3.7.0 (v3.7.8:1bf9cc5893, Jun 26 2018, 23:26:24) [Clang 6.0 (clang-680.0.57)] on darwin Type "copyright", "credits" or "license" for more information. RESTART: /Users/Ldipippo/Documents/csc 110/homework/hw-solutions-fall18/hw3-1-speed difference.py How many cars passed the sensor? 10 Enter speed for car 1 : 65 Enter speed for car 2 : 75 Enter speed for car 3 : 87 Enter speed for car 4 : 45 Enter speed for car 5 : 55 Enter speed for car 6:58 Enter speed for car 7: 66 Enter speed for car 8 : 79 Enter speed for car 9: 84 Enter speed for car 10 : 66 The difference in speed between the fastest car and the slowest car is 42 mph LA: 18 Col: 4Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started