Advertisement
Dimitar23308

Untitled

Nov 18th, 2023 (edited)
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.66 KB | None | 0 0
  1. зад 1
  2.  
  3.  
  4. teatur=input()
  5. rows=int(input())
  6. columns=int(input())
  7.  
  8. capacity=rows*columns
  9. money=0
  10.  
  11.  
  12. if teatur=="Premiere":
  13.     money=12
  14. elif teatur=="Normal":
  15.     money=7.50
  16. elif teatur=="Discount":
  17.     money=5
  18. total_sum=capacity * money
  19.  
  20. print(f"{total_sum:.2f} leva")
  21.  
  22.  
  23. зад 2
  24.  
  25. degrees=int(input())
  26. time_of_day=input()
  27.  
  28. outfit=0
  29. shoes=0
  30.  
  31.  
  32. if degrees<=18:
  33.     if time_of_day=="Morning":
  34.         outfit="Sweatshirt"
  35.         shoes="Sneakers"
  36.     else:
  37.         outfit="Shirt"
  38.         shoes="Moccasins"
  39. elif degrees<=24:
  40.     if time_of_day=="Afternoon":
  41.         outfit="T-Shirt"
  42.         shoes="Sandals"
  43.     else:
  44.         outfit="Shirt"
  45.         shoes="Moccasins"
  46. else:
  47.     if time_of_day=="Afternoon":
  48.         outfit="Swim Suit"
  49.         shoes="Barefoot"
  50.     else:
  51.         outfit="Shirt"
  52.         shoes="Moccasins"
  53.  
  54. print(f"It's {degrees} degrees, get your {outfit} and {shoes}.")
  55.  
  56.  
  57. зад 3
  58.  
  59.  
  60. elif flower_type=="Dahlias":
  61.     price=3.80*flower_count
  62.     if flower_count>90:
  63.         price*=0.85
  64. elif flower_type=="Tulips":
  65.     price = 2.80*flower_count
  66.     if flower_count>80:
  67.         price*=0.85
  68. elif flower_type=="Narcissus":
  69.     price=3*flower_count
  70.     if flower_count < 120:
  71.         price*=1.15
  72. elif flower_type=="Gladiolus":
  73.     price = 2.50*flower_count
  74.     if flower_count<80:
  75.         price*=1.2
  76.  
  77. if budget>=price:
  78.     print(f"Hey, you have a great garden with {flower_count} {flower_type} and {budget - price:.2f} leva left.")
  79. else:
  80.     print(f"Not enough money, you need {price - budget:.2f} leva more.")
  81.  
  82.    
  83. зад 4
  84.  
  85.  
  86. budget=int(input())
  87. season=input()
  88. num_friends=int(input())
  89.  
  90. if season=="Spring":
  91.     base_price=3000
  92. elif season=="Summer" or season == "Autumn":
  93.     base_price=4200
  94. else:
  95.     base_price=2600
  96.  
  97. if num_friends<=6:
  98.     discount=0.1
  99. elif num_friends<=11:
  100.     discount=0.15
  101. else:
  102.     discount=0.25
  103.  
  104. total_price=base_price * (1 - discount)
  105.  
  106. if num_friends % 2 == 0:
  107.     if season=="Autumn":
  108.         total_price=total_price
  109.     else:
  110.         total_price*=0.95
  111.  
  112. if budget>=total_price:
  113.     print(f"Yes! You have {budget - total_price:.2f} leva left.")
  114. else:
  115.     print(f"Not enough money! You need {total_price - budget:.2f} leva.")
  116.    
  117.    
  118.  
  119. зад 5
  120.  
  121.  
  122. budget=int(input())
  123. season=input()
  124. num_friends=int(input())
  125.  
  126. if season=="Spring":
  127.     base_price=3000
  128. elif season=="Summer" or season == "Autumn":
  129.     base_price=4200
  130. else:
  131.     base_price=2600
  132.  
  133. if num_friends<=6:
  134.     discount=0.1
  135. elif num_friends<=11:
  136.     discount=0.15
  137. else:
  138.     discount=0.25
  139.  
  140. total_price=base_price*(1 - discount)
  141.  
  142. if num_friends % 2 == 0:
  143.     if season=="Autumn":
  144.         total_price=total_price
  145.     else:
  146.         total_price*=0.95
  147.  
  148. if budget>=total_price:
  149.     print(f"Yes! You have {budget - total_price:.2f} leva left.")
  150. else:
  151.     print(f"Not enough money! You need {total_price - budget:.2f} leva.")
  152.    
  153.  
  154. зад 6
  155.  
  156.  
  157. budget = float(input("Enter your budget: "))
  158. season = input("Enter the season (summer/winter): ")
  159.  
  160. destination = "0"
  161. vacation_type = "0"
  162. spent_money = 0
  163.  
  164. if budget <= 100:
  165.     destination = "Bulgaria"
  166.     if season == "summer":
  167.         vacation_type = "Camp"
  168.         spent_money = budget * 0.3
  169.     elif season == "winter":
  170.         vacation_type = "Hotel"
  171.         spent_money = budget * 0.7
  172. elif budget <= 1000:
  173.     destination = "Balkans"
  174.     if season == "summer":
  175.         vacation_type = "Camp"
  176.         spent_money = budget * 0.4
  177.     elif season == "winter":
  178.         vacation_type = "Hotel"
  179.         spent_money = budget * 0.8
  180. else:
  181.     destination = "Europe"
  182.     vacation_type = "Hotel"
  183.     spent_money = budget * 0.9
  184.  
  185. print(f"Somewhere in {destination}")
  186. print(f"{vacation_type} - {spent_money:.2f}")
  187.  
  188.  
  189.  
  190. зад 7
  191.  
  192.  
  193.  
  194. N1=int(input())
  195. N2=int(input())
  196. operator=input()
  197.  
  198. if operator=='+':
  199.     result=N1 + N2
  200.     if result % 2 == 0:
  201.         print(f"{N1} {operator} {N2}={result} - even")
  202.     else:
  203.         print(f"{N1} {operator} {N2}={result} - odd")
  204. elif operator=='-':
  205.     result = N1 - N2
  206.     if result % 2 == 0:
  207.         print(f"{N1} {operator} {N2}={result} - even")
  208.     else:
  209.         print(f"{N1} {operator} {N2}={result} - odd")
  210. elif operator=='*':
  211.     result=N1*N2
  212.     if result % 2 == 0:
  213.         print(f"{N1} {operator} {N2}={result} - even")
  214.     else:
  215.         print(f"{N1} {operator} {N2}={result} - odd")
  216. elif operator=='/':
  217.     if N2==0:
  218.         print(f"Cannot divide {N1} by zero")
  219.     else:
  220.         result=N1 / N2
  221.         print(f"{N1} / {N2} = {result:.2f}")
  222. elif operator=='%':
  223.     if N2==0:
  224.         print(f"Cannot divide {N1} by zero")
  225.     else:
  226.         result=N1 % N2
  227.         print(f"{N1} % {N2}={result}")
  228. зад 8
  229.  
  230. господине 8 ма задача не я разбирам мисля че имам представа как трябва да се направи но не съм сигурен
  231.  
  232. зад 9
  233.  
  234. days= int(input())
  235. room_type= input()
  236. rating= input()
  237. discount= 0
  238.  
  239. nights=days - 1
  240.  
  241. if room_type== "room for one person":
  242.     price= 180.00 * nights
  243.     discount= 0
  244. elif room_type== "apartment":
  245.     price= 250.00 * nights
  246.     if nights< 10:
  247.         discount= 0.3
  248.     elif 10<= nights<= 15:
  249.         discount= 0.35
  250.     else:
  251.         discount= 0.5
  252. elif room_type== "president apartment":
  253.     price=350.00 * nights
  254.     if nights<10:
  255.         discount= 0.1
  256.     elif 10<= nights<=15:
  257.         discount=0.15
  258.     else:
  259.         discount=0.2
  260.  
  261. price_after_discount = price-(price * discount)
  262.  
  263. if rating== "positive":
  264.     final_price= price_after_discount+price_after_discount * 0.25
  265. else:
  266.     final_price= price_after_discount - price_after_discount * 0.1
  267.  
  268. print(f"{final_price:.2f}")
  269.  
  270.  
  271.  
  272.  
  273.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement