Question: use python Design a function called print_speeding_results that takes two integers as parameters: 1) the current speed of a vehicle, and 2) the speed limit
use python
Design a function called print_speeding_results that takes two integers as parameters: 1) the current speed of a vehicle, and 2) the speed limit of the road the vehicle is currently driving on Remember: The arguments MUST be in this order. If the speed of the vehicle is greater than the speed limit, the function should print: Speeding! Xkm/hr over the speed limit where X represents how far above the speed limit the vehicle was driving If the speed of the vehicle is less than or equal to the speed limit, the function should print: Current speed: Xkm/hr, limit: Ykm/hr where X represents the current speed of the vehicle, and Y represents the given speed limit For example, if the speed of the vehicle is 56km/hr and the speed limit is 80km/hr, the output is: Current speed: 56km/hr, limit: 80km/hr Preconditions: The speed of the vehicle and the speed limit are both at least 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
