Advertisement
Kamend1

new house

Jul 19th, 2024
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.37 KB | None | 0 0
  1. type_flowers = str(input())
  2. number_flowers = int(input())
  3. budget = int(input())
  4.  
  5. whole_price = 0
  6.  
  7. if type_flowers == 'Roses':
  8.     if number_flowers > 80:
  9.         whole_price = number_flowers * 5
  10.         whole_price *= 0.9
  11.  
  12.     elif number_flowers <= 80:
  13.         whole_price = number_flowers * 5
  14.  
  15. if type_flowers == 'Dahlias':
  16.     if number_flowers > 90:
  17.         whole_price = number_flowers * 3.85
  18.         whole_price *= 0.85
  19.  
  20.     elif number_flowers <= 90:
  21.         whole_price = number_flowers * 3.85
  22.  
  23. if type_flowers == 'Tulips':
  24.     if number_flowers > 80:
  25.         whole_price = number_flowers * 2.80
  26.         whole_price *= 0.85
  27.  
  28.     elif number_flowers <= 80:
  29.         whole_price = number_flowers * 2.80
  30.  
  31. if type_flowers == 'Narcissus':
  32.     if number_flowers >= 120:
  33.         whole_price = number_flowers * 3
  34.        
  35.     elif number_flowers < 120:
  36.         whole_price = number_flowers * 3
  37.         whole_price *= 1.15
  38.  
  39.  
  40. if type_flowers == 'Gladiolus':
  41.     if number_flowers >= 80:
  42.         whole_price = number_flowers * 2.50
  43.        
  44.  
  45.     elif number_flowers < 80:
  46.         whole_price = number_flowers * 2.50
  47.         whole_price *= 1.2
  48.  
  49. difference = abs(whole_price - budget)
  50.  
  51. if whole_price >= budget:
  52.     print(f"Not enough money, you need {difference:.2f} leva more.")
  53. else:
  54.     print(f"Not enough money, you need {difference:.2f} leva more.")
  55.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement