Python Challenge 1

[Deleted User][Deleted User] Sec+Posts: 0 Mod
edited June 2019 in Scripting
Write a function called "traffic_cop" for enforcing the speed limit. The function should take one parameter named "speed". The parameter "speed" shall be of type integer.
  1. The speed limit is 75mph.
  2. For every MPH over the speed limit, the driver is fined $12.47.
  3. If the driver is going more than 20mph over the speed limit there licence is suspended. 
  4. If the function receives a speed over the limit it should print the fine amount.
  5. The Function should also print a message if a driver's licence is going to be suspended a message is printed.
  6. A generic message should be printed if the speed is at or below the speed limit.
Sign In or Register to comment.