You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

23 lines
840 B

#!/usr/bin/env python3
#title :10-2.py
#description :10.2: User input & exceptions
#author :Marcel Haazen
#email :marcel@haazen.xyz
#date :07-11-2019 - 11:45
#edit_date :07-11-2019 - 11:54
#version :0.1
#usage :python3 10-2.py
#notes :
#python_version :3.7.4
#==============================================================================
while True:
try:
uurloon = float(input("Wat is je uurloon?"))
uren = float(input("Hoeveel uur heb je gewerkt?"))
assert uren > 0
print("Je salaris is", uurloon*uren, "Euro")
break
except ValueError:
print("Wij accepteren aleen cijfers geen andere characters")
except AssertionError:
print("Negatieve werk uren !? Wil je gaan betalen inplaats van betaald worden?")