Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rate1 = 5
- rate2 = 4
- rate3 = 3
- m = int(input(" Please enter number of minutes parked..."))
- if ( m <= 60 ):
- # the fee will always be the same rate if 60 minutes or less, equation unnessary and when m = 60 the +1 was charging
- # for 2 hours, it was more efficient to reduce the work here
- fee = rate1
- print("Parking fee for ", m, " minutes is $", fee)
- elif ( m <= 300 ):
- hrs = int(m/60)
- if ( m % 60 != 0 ):
- hrs += 1
- fee2 = hrs*rate2
- print("Parking fee for ", m, " minutes is $", fee2)
- else:
- hrs = int(m/60)
- if ( m % 60 != 0 ):
- hrs += 1
- fee3 = hrs*rate3
- print("Parking fee for ", m, " minutes is $", fee3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement