Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. def main():
  2. cont = 1
  3. print("Ohjelma laskee osa-aikatoiden palkkoja.")
  4. while(cont != 0):
  5. payt = int(input("Anna kokopaivatyon palkka (eur / kk).\n"))
  6. hours = float(input("Anna tyotunnit viikossa.\n"))
  7. if payt < 0 or hours < 0 or hours > 37.5:
  8. print("Palkka tai tuntimaara ei ole sallitulla valilla!")
  9. else:
  10. paym = laske_palkka(payt, hours)
  11. print("Palkka on",paym, "eur.\n")
  12. cont = int(input("Haluatko jatkaa (1 = kylla / 0 = ei)?\n"))
  13. print("Ohjelman suoritus paattyy.")
  14. def laske_palkka(payt, hours):
  15. pay = hours / 37.5 * payt
  16. return pay
  17. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement