21 lines
582 B
Python
21 lines
582 B
Python
|
|
||
|
def boolInput(question):
|
||
|
while True:
|
||
|
try:
|
||
|
choice = input(question)
|
||
|
assert choice in ['J', 'j', 'N', 'n']
|
||
|
return choice in ['J','j']
|
||
|
except AssertionError:
|
||
|
print('Skriv in J eller N\n')
|
||
|
|
||
|
def discountBranch():
|
||
|
choseDiscount = boolInput('Minipris 199,- kan ikke refunderes/endres\nØnskes dette (J/N)? ')
|
||
|
print('Takk for pengene, god reise!' if choseDiscount else 'Da tilbyr vi fullpris: 440,-')
|
||
|
|
||
|
|
||
|
daysToTrip = int(input('Dager til du skal reise? '))
|
||
|
|
||
|
if daysToTrip >= 14:
|
||
|
discountBranch()
|
||
|
else:
|
||
|
print('For sent for minipris; fullpris 440,-')
|