Advertisement
sredo

06. Happy Cat Parking

Jun 20th, 2018
663
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. days = int(input())
  2. hours_per_day = int(input())
  3.  
  4. price = 0
  5. price_per_day = 0
  6.  
  7. for day in range(1, days + 1):
  8. if day > 1:
  9. print(f'Day: {day - 1} - {price_per_day:.2f} leva')
  10. price += price_per_day
  11. price_per_day = 0
  12. for hour in range(1, hours_per_day + 1):
  13. if day % 2 == 0 and not hour % 2 == 0:
  14. price_per_day += 2.50
  15. elif not day % 2 == 0 and hour % 2 == 0:
  16. price_per_day += 1.25
  17. else:
  18. price_per_day += 1
  19.  
  20. price += price_per_day
  21. print(f'Day: {day} - {price_per_day:.2f} leva')
  22. print(f'Total: {price:.2f} leva')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement