pacho_the_python

Untitled

Oct 6th, 2021
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.42 KB | None | 0 0
  1. flower = input()
  2. flower_count = int(input())
  3. budget = int(input())
  4.  
  5. price = 0
  6.  
  7.  
  8. if flower == "Roses":
  9.     roses_price = flower_count * 5
  10.     if flower_count > 80:
  11.         discount = roses_price * 0.1
  12.         price = roses_price - discount
  13.     else:
  14.         price = roses_price
  15.  
  16. elif flower == "Dahlias":
  17.     dahlias_price = flower_count * 3.80
  18.     if flower_count > 90:
  19.         discount = dahlias_price * 0.15
  20.         price = dahlias_price - discount
  21.     else:
  22.         price = dahlias_price
  23.  
  24. elif flower == "Tulips":
  25.     tulip_price = flower_count * 2.80
  26.     if flower_count > 80:
  27.         discount = tulip_price * 0.15
  28.         price = tulip_price - discount
  29.     else:
  30.         price = tulip_price
  31.  
  32. elif flower == "Narcissus":
  33.     narcissus_price = flower_count * 3
  34.     if flower_count < 120:
  35.         discount = narcissus_price * 0.15
  36.         price = narcissus_price + discount
  37.     else:
  38.         price = narcissus_price
  39.  
  40. elif flower == "Gladiolus":
  41.     gladiolus_price = flower_count * 2.50
  42.     if flower_count < 80:
  43.         discount = gladiolus_price * 0.2
  44.         price = gladiolus_price + discount
  45.     else:
  46.         price = gladiolus_price
  47.  
  48. if budget >= price:
  49.     money_left = budget - price
  50.     print(f"Hey, you have a great garden with {flower_count} {flower} and {money_left:.2f} leva left.")
  51. else:
  52.     money_need = price - budget
  53.     print(f"Not enough money, you need {money_need:.2f} leva more.")
Advertisement
Add Comment
Please, Sign In to add comment