Python Challenge 1

InfoSec_ScottInfoSec_Scott Sec+Posts: 4Mod Mod
edited June 24 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.
Tagged:
Sign In or Register to comment.