fork download
  1. print("Система расчета штрафов")
  2.  
  3. car_speed = 97
  4. is_town = True
  5.  
  6.  
  7. fine_for_20_to_40 = 500
  8. fine_for_40_to_60 = 1000
  9. fine_for_60_to_80 = 2000
  10. fine_for_80_to_more = 5000
  11.  
  12. town_speed = 60
  13. country_speed = 90
  14.  
  15. if is_town:
  16. over_speed = car_speed - town_speed
  17. else:
  18. over_speed = car_speed - country_speed
  19.  
  20. if over_speed < 20:
  21. print("Скорость не привышена или превышена незначительно")
  22. elif over_speed >= 20 and over_speed < 40:
  23. print("Штраф: " + str(fine_for_20_to_40))
  24. elif over_speed >= 40 and over_speed < 60:
  25. print("Штраф: " + str(fine_for_40_to_60))
  26. elif over_speed >= 60 and over_speed < 80:
  27. print("Штраф: " + str(fine_for_60_to_80))
  28. elif over_speed >= 80:
  29. print("Штраф: " + str(fine_for_80_to_more))
Success #stdin #stdout 0.01s 7068KB
stdin
Standard input is empty
stdout
Система расчета штрафов
Штраф: 500