Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

29 rindas
909 B

pirms 5 gadiem
  1. #!/usr/bin/env python3
  2. #title :FA-1.py
  3. #description :Final Assignemt: NS Functies
  4. #author :Marcel Haazen
  5. #email :marcel@haazen.xyz
  6. #date :23-09-2019 - 11:53
  7. #version :0.1
  8. #usage :python3 FA-1.py
  9. #notes :
  10. #python_version :3.7.4
  11. #==============================================================================
  12. def standaardtarief(afstandKM):
  13. price = 0.0
  14. if afstandKM <0:
  15. # If distance is negative or 0 the price is also 0
  16. return 0.0
  17. elif afstandKM > 50:
  18. # As of 50 KM the price per KM gets decreased to 60 cents bet gets a base price of 15 euro on top
  19. price = round(15.0 + (afstandKM * 0.6), 2)
  20. return price
  21. else:
  22. # Calculate price per KM based on 80 cents per KM and no base price
  23. price = round(afstandKM * 0.8, 2)
  24. return price
  25. ritprijs
  26. print(standaardtarief(25))