15 Oct Monday 17:30 Python Practice – 22.10.10.
Question 1:(please use function that return a value)
Write a program to display information to a driver based on his/her speed according to the following table:
km/h over the limit | Fine |
1 to 20 | $100 |
21 to 30 | $270 |
31 or above | $500 |
Sample Input 1: Enter the speed limit: 40 Enter the recorded speed of the car: 39 Sample output 1: Congratulations, you are within the speed limit!
Sample Input 2: Enter the speed limit: 100 Enter the recorded speed of the car: 131 Sample output 2: You are speeding and your fine is $500
Sorry, the comment form is closed at this time.