• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# New House

mark79 Jan 28th, 2020 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. flower = input()
2. qty = int(input())
3. budget = int(input())
4.
5. flower_price = 0
6. if flower == "Roses":
7.     flower_price = 5 * 0.9 if qty > 80 else 5
8. elif flower == "Dahlias":
9.     flower_price = 3.8 * 0.85 if qty > 90 else 3.8
10. elif flower == "Tulips":
11.     flower_price = 2.8 * 0.85 if qty > 80 else 2.8
12. elif flower == "Narcissus":
13.     flower_price = 3 * 1.15 if qty < 120 else 3
15.     flower_price = 2.5 * 1.2 if qty < 80 else 2.5
16.
17. total_price = qty * flower_price
18. result = abs(total_price - budget)
19.
20. if total_price > budget:
21.     print(f"Not enough money, you need {result:.2f} leva more.")
22. else:
23.     print(f"Hey, you have a great garden with {qty} {flower} and {result:.2f} leva left.")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
Top