CCC 2012 J1: Speed Fines are Not Fine!
- Mac Zhang
- Jul 26, 2020
- 1 min read
Simple if and else-if statements while comparing inputs
limit = int(input("Enter the speed limit:"))
speed = int(input("Enter the recorded speed of the car:"))
if speed <= limit:
print("Congratulations, you are within the speed limit!")
elif speed <= limit + 20:
print("You are speeding and your fine is $100.")
elif speed <= limit + 30:
print("You are speeding and your fine is $270.")
else:
print("You are speeding and your fine is $500.")
Comments