Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fruit = input()
- day = input()
- amount = float(input())
- valid = False
- if day == "Monday" or day == "Tuesday" or day == "Wednesday" or day == "Thursday" or day == "Friday" or\
- day == "Saturday" or day == "Sunday":
- valid = True
- weekend = day[0] == "S"
- if valid:
- if fruit == "banana":
- price = 2.7 if weekend else 2.5
- elif fruit == "apple":
- price = 1.25 if weekend else 1.2
- elif fruit == "orange":
- price = 0.90 if weekend else 0.85
- elif fruit == "grapefruit":
- price = 1.6 if weekend else 1.45
- elif fruit == "kiwi":
- price = 3.0 if weekend else 2.7
- elif fruit == "pineapple":
- price = 5.6 if weekend else 5.5
- elif fruit == "grapes":
- price = 4.2 if weekend else 3.85
- else:
- valid = False
- print(f"{amount * price:.2f}" if valid else "error")
Add Comment
Please, Sign In to add comment