Advertisement
Dimitar23308

Всички Домашни

Dec 22nd, 2023 (edited)
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 28.60 KB | None | 0 0
  1. 1/10/23
  2.  
  3.  
  4.  
  5. заадача 1 :
  6.  
  7. usd=float(input("Въведете сумата, която искате да .пресметнете: "))
  8.  
  9. bgn=usd*1.79549
  10.  
  11. print(bgn)
  12.  
  13.  
  14.  
  15.  
  16. задача 2:
  17.  
  18. from math import pi
  19. from math import floor
  20.  
  21.  
  22. radians = float(input("Enter radians: "))
  23. degrees = radians*180 /pi
  24.  
  25. print(floor(degrees))
  26.  
  27.  
  28.  
  29. !задача 3:
  30.  
  31. deposit_sum=float(input("Please enter depsoit sum"))
  32.  
  33. month_of_deposit=int(input("Please enter mount of deposit"))
  34.  
  35. year_percent=float(input("Please enter year percecnt"))
  36.  
  37. total_sum = deposit_sum + ((deposit_sum*year_percent)/12)
  38. print(f"total_sum {int(total_sum):.2f}")
  39.  
  40. задача 4:
  41.  
  42. all_hours_reading=int(input("Въведете общ брой страници"))
  43. pages_per_hour=int(input("Въвеедете колко страници биват прочетени за час"))
  44. days_left=int(input("Въведете дните, за които трябва да бъде прочетена книгата"))
  45.  
  46. hours_should_read=all_hours_reading/(pages_per_hour*days_left)
  47.  
  48. print(int(hours_should_read))
  49.  
  50.  
  51. задача 5
  52.  
  53. number_of_pens = int(input("Брой пакети химикали: "))
  54. number_markers = int(input("Брой пакети маркери: "))
  55. liters_detergent = int(input("Литри препарат за почистване на дъска: "))
  56. percent_reduction = int(input("Процент намаление: "))
  57.  
  58. packet_of_pens=5.80
  59. packet_of_markers = 7.20
  60. preparat=1.20
  61.  
  62. total_pens = number_of_pens * packet_of_pens
  63. total_markers = number_markers * packet_of_markers
  64. total_preparat = liters_detergent * preparat
  65.  
  66. total_cost = total_pens + total_markers + total_preparat
  67.  
  68. total_cost_after_reduction=total_cost - (total_cost * (percent_reduction / 100))
  69. print(float(total_cost_after_reduction))
  70.  
  71.  
  72.  
  73.  
  74. !задача 6: господине 6 - тази задача не мога да разбера формулите по които да изчислява, пиша формули които са верни според мен, но със примерните входове не излиза общия разход
  75.  ето задачата но има нещо грешно, което не мога да усмисля:
  76.  
  77.  zad 6
  78. nylon_square_meters=int(input("Въведете необходимо количество найлон (в кв.м.): "))
  79. paint_liters=int(input("Въведете необходимо количество боя (в литри) "))
  80. razreditel_liters=int(input("Въведете количество разредител (в литри)"))
  81. hours_of_work=int(input("Въведете часовете, за които майсторите ще свършат работата: "))
  82.  
  83.  
  84. nylon_price_per_square_meter =  1.50
  85. paint_price_per_liter = 14.50
  86. thinner_price_per_liter = 5.00
  87. bag_price = 0.40
  88.  
  89.  
  90. total_nylon_cost = nylon_square_meters * nylon_price_per_square_meter + (0.10*nylon_square_meters) + 2
  91. total_paint_cost = paint_liters * paint_price_per_liter
  92. total_razreditel_cost = razreditel_liters * thinner_price_per_liter
  93. total_bag_cost = 0.40
  94. total_materials_cost = total_nylon_cost + total_paint_cost + total_razreditel_cost + total_bag_cost
  95. total_labor_cost = 0.30 * (total_bag_cost+total_materials_cost)
  96. total_cost = total_materials_cost + total_labor_cost
  97.  
  98. print(f"Сумата на всички разходи е: {total_cost:.2f} лв.")
  99.  
  100.  
  101.  
  102.  
  103.  
  104. !задача 7
  105.  
  106. chicken_menu_number=int(input("Въведете брой пилешки менюта: "))
  107. fish_menu_number=int(input("Въведете врой рибени менюта" ))
  108. vegitarian_number=int(input("Въведете брой вегетариански менюта"))
  109.  
  110. chicken_menu_price=10.35
  111. fish_menu_price=12.40
  112. vegetarian_menu_prce=8.15
  113.  
  114. total_chicken_menu_cost=chicken_menu_number*chicken_menu_price
  115. total_fish_menu_cost=fish_menu_number*fish_menu_price
  116. total_vegetarian_menu_cost=vegitarian_number*vegetarian_menu_prce
  117.  
  118. total_cost_without_dilivery=0.20*(total_chicken_menu_cost+total_fish_menu_cost+total_vegetarian_menu_cost)
  119. total_cost_with_delivary=0.20*(total_chicken_menu_cost+total_fish_menu_cost+total_vegetarian_menu_cost)+2.50
  120. print(f"Сумата на всички разходи е: {total_cost_with_delivary:.2f} лв.")
  121.  
  122. !задача 8
  123.  
  124. year_price=float(input("Въведете годишна такса за тренировки"))
  125.  
  126. shoes_price = year_price * 0.6
  127. uniform_price = shoes_price * 0.8
  128. ball_price = uniform_price / 4
  129. accessories_price = ball_price / 5
  130.  
  131. total_cost = shoes_price + uniform_price + ball_price + accessories_price
  132. print(f"Pesho has need {total_cost:.2f} leva for training!")
  133.  
  134.  
  135. зад 9
  136.  
  137.  
  138. length = int(input())
  139. width = int(input())
  140. height = int(input())
  141. percentage = float(input())
  142.  
  143. volume = (length/10) * (width/10) * (height/10)
  144.  
  145. liters_water = volume * (1 - percentage / 100)
  146.  
  147. print(liters_water)
  148.  
  149.  
  150. Oct 17 2023
  151.  
  152.  
  153. задача 4 та
  154.  
  155. grade = float(input("Моля, въведете оценката: "))
  156.  
  157. if 2.00 <= grade < 3.00:
  158.     print("Слаб")
  159. elif 3.00 <= grade < 3.50:
  160.     print("Среден")
  161. elif 3.50 <= grade < 4.50:
  162.     print("Добър")
  163. elif 4.50 <= grade < 5.50:
  164.     print("Много добър.")
  165. elif 5.50 <= grade <= 6.00:
  166.     print("Отличен.")
  167. else:
  168.     print("Невалидна оценка ")
  169.  
  170.  
  171. Задача 5 та
  172.  
  173. winning_number = 7
  174.  
  175. guess = int(input("Опитайте да познаете числото: "))
  176. if guess < winning_number:
  177.     print("Числото е по-малко.")
  178. elif guess > winning_number:
  179.     print("Числото е по-голямо.")
  180. else:
  181.     print("Браво! Познахте числото.")
  182.  
  183.  
  184.  
  185. задача 6 та
  186.  
  187. speed = float(input("Въведете скоростта на Стамат: "))
  188.  
  189. if speed <= 15:
  190.     print("slow")
  191. elif speed <= 55:
  192.     print("average")
  193. elif speed <= 100:
  194.     print("fast")
  195. elif speed <= 150:
  196.     print("ultra fast")
  197. else:
  198.     print("extremely fast")
  199.  
  200. зад 7
  201.  
  202. import math
  203.  
  204. figure_type = input("Въведете вида на фигурата (square, rectangle, circle, triangle): ")
  205. if figure_type == "square":
  206.     side = float(input("Въведете дължината на страната на квадрата: "))
  207.     area = round(side ** 2, 4)
  208. elif figure_type == "rectangle":
  209.     side1 = float(input("Въведете дължината на едната страна на правоъгълника: "))
  210.     side2 = float(input("Въведете дължината на другата страна на правоъгълника: "))
  211.     area = round(side1 * side2, 4)
  212. elif figure_type == "circle":
  213.     radius = float(input("Въведете радиуса на кръга: "))
  214.     area = round(math.pi * (radius ** 2), 4)
  215. elif figure_type == "triangle":
  216.     side = float(input("Въведете дължината на страната на триъгълника: "))
  217.     height = float(input("Въведете дължината на височината към нея: "))
  218.     area = round((side * height) / 2, 4)
  219. else:
  220.     print("Невалиден тип фигура.")
  221.     exit(0)
  222.  
  223. print(f"Лицето на фигурата е: {area}")
  224.  
  225.  
  226. Oct 23/23
  227.  
  228. #зад. 2
  229.  
  230. points=int(input("Въведете точки: "))
  231. bonus=0
  232.  
  233.  
  234. if points <= 100:
  235.     bonus+= 5
  236. elif points>100 and points <= 1000:
  237.     bonus+= points * 0.2
  238. else:
  239.     bonus += points * 0.1
  240.  
  241.  
  242. if points % 2 == 0:
  243.     bonus+= 1
  244. elif points % 10 == 5:
  245.     bonus+= 2
  246.  
  247. print(bonus)
  248. print(points +bonus)
  249.  
  250.  
  251. #зад. 3
  252.  
  253.  
  254. start_time_hours=int(input("Въведете колко часа е"))
  255. start_time_minutes=int(input("Въведете колко минути е "))
  256.  
  257.  
  258. end_minutes= start_time_minutes + 15
  259.  
  260. if end_minutes> 59:
  261.     start_time_hours += 1
  262.     end_minutes -= 60
  263.  
  264.  
  265. if start_time_hours> 23:
  266.     start_time_hours=0
  267.  
  268.  
  269. print(f"{start_time_hours:02d}:{end_minutes:02d}")
  270.  
  271. #зад. 4
  272. trip_price=float(input("Въведете цената на екскурзията: "))
  273. biscuit_cake_number=int(input("Въведете броя на бисквитените торти: "))
  274. skalichki_number=int(input("Въъведете броя на скаличките: "))
  275. chocolate_cake_number=int(input("Въвведете броя на парчетата шоколадовите торти: "))
  276. red_cadife_cake_number=int(input("Въведете брой парчета торта червено кадифе"))
  277. еclers_number=int(input("Въведете брой еклери:"))
  278.  
  279.  
  280. biscuit_cake=2.60
  281. skalichka=3.00
  282. chocolate_cake=4.10
  283. red_cadife_cake=8.20
  284. ecler=2.00
  285.  
  286.  
  287. biscuit_cake_price=biscuit_cake_number*biscuit_cake
  288. skalichka_price=skalichki_number*skalichka
  289. chocolate_cake_price=chocolate_cake_number*chocolate_cake
  290. red_cadife_price=red_cadife_cake_number*red_cadife_cake
  291. ecler_price=еclers_number*ecler
  292.  
  293. order_price=biscuit_cake_number*biscuit_cake+skalichki_number*skalichka+chocolate_cake_number*chocolate_cake+red_cadife_cake_number*red_cadife_cake+еclers_number*ecler
  294.  
  295. order_numbers=trip_price+biscuit_cake_number+skalichki_number+chocolate_cake_number+red_cadife_cake_number+еclers_number
  296. if order_numbers > 50:
  297.     order_price *= 0.75
  298. comission = order_price * 0.10
  299. order_price -= comission
  300.  
  301.  
  302. if order_price >= trip_price:
  303.     print(f"Yes! {order_price - trip_price:.2f} lv left.")
  304. else:
  305.     print(f"Not enough money! {trip_price - order_price:.2f} lv needed.")
  306.  
  307. #зад. 5
  308.  
  309. match_budget=float(input(("Въведете бюджета за мача:")))
  310. staff_number=int(input("Въведете броят на персонала:"))
  311. staff_uniform_price_per_person=float(input("Въведете цена за облекло на един човек от персонала"))
  312. decor = match_budget*0.10
  313. if staff_number>150:
  314.     staff_uniform_price_per_person * 0.90
  315.  
  316. total_uniform_price=staff_uniform_price_per_person*staff_number
  317. total_match_expencess=decor+total_uniform_price
  318.  
  319. if total_match_expencess > match_budget:
  320.     print("Not enough money!")
  321.     print(f"Wingard needs {total_match_expencess - match_budget:.2f} leva more.")
  322. else:
  323.     print("Action!")
  324.     print(f"Wingard starts filming with {match_budget - total_match_expencess:.2f} leva left.")
  325.  
  326.  
  327. #зад. 6
  328.  
  329. record=float(input("Въведете рекорд:"))
  330. distance=float(input("Въведете разстояние: "))
  331. time_per_meter=float(input("Въведете време в секунди за спускане на 1 метър: "))
  332.  
  333. total_time=distance*time_per_meter
  334. zabavqne=(distance//15)*12.5
  335. total_time += zabavqne
  336.  
  337.  
  338. if total_time<record:
  339.     print(f"Yes, she succeeded! The new world record is {total_time:.2f} seconds.")
  340. else:
  341.     print(f"No, she failed! She was {total_time - record:.2f} seconds slower.")
  342.  
  343. #зад. 7
  344. gosho_budget=float(input("Гоше, къв ти е бюджета?"))
  345. video_cards_number=int(input("Гоше, колко видео карти?"))
  346. proccesors_number=int(input("Гоше, колко процесора?"))
  347. ram_number=int(input("Гоше колко рам искаш?"))
  348.  
  349. video_card_price=250
  350. video_cards_espenses=video_cards_number*video_card_price
  351. proccesor_price=video_cards_espenses*0.35
  352. ram_price=video_cards_espenses*0.10
  353.  
  354. proccesors_expenses=proccesors_number*proccesor_price
  355. ram_expenses=ram_number*ram_price
  356. all_expenses=proccesors_expenses+ram_expenses+video_cards_espenses
  357.  
  358. if gosho_budget >= all_expenses:
  359.     print(f"You have {gosho_budget - all_expenses} leva left!")
  360. else:
  361.     print(f"Not enough money! You need {all_expenses - gosho_budget:.2f} leva more!")
  362.    
  363. #зад. 8
  364.  
  365. import math
  366.  
  367. tutorial_name=input("Въведете името на клипа")
  368. video_duration=int(input("Въведете продължителността на видеото: "))
  369. break_duration=int(input("Въведете продължителността на почивката: "))
  370.  
  371. eating_time=break_duration/8
  372. break_time=break_duration/4
  373. all_free_time=break_duration-eating_time-break_time
  374.  
  375. if all_free_time >=video_duration:
  376.     left_time= math.ceil(all_free_time - video_duration)
  377.     print(f"You have enough time to watch {tutorial_name} and left with {left_time} minutes free time.")
  378. else:
  379.     nujno_vreme= math.ceil(video_duration - all_free_time)
  380.     print(f"You don't have enough time to watch {tutorial_name}, you need {nujno_vreme} more minutes.")
  381.  
  382.  
  383. Nov 8/23
  384.  
  385. зад.1
  386.  
  387.  
  388. number = int(input())
  389.  
  390. if number == 1:
  391.     print("Monday")
  392. elif number==2:
  393.     print("Tuesday")
  394. elif number==3:
  395.     print("Wednesday")
  396. elif number==4:
  397.     print("Thursday")
  398. elif number==5:
  399.     print("Friday")
  400. elif number==6:
  401.     print("Saturday")
  402. elif number==7:
  403.     print("Sunday")
  404. else:
  405.     print("Wrong number!")
  406.  
  407. зад.2
  408.  
  409. day=input("Въведете ден:")
  410.  
  411. if day == "Monday":
  412.  print("Study day")
  413. elif day == "Tuesday":
  414.  print("Study day")
  415. elif day == "Wednesday":
  416.  print("Study day")
  417. elif day == "Thursday":
  418.  print("Study day")
  419. elif day == "Friday":
  420.  print("Study day")
  421. elif day == "Saturday":
  422.  print("Weekend")
  423. elif day == "Sunday":
  424.  print("Weekend")
  425. else:
  426.     print("Wrong day")
  427.  
  428. зад.3
  429.  
  430.  
  431. student_number = input("Enter a student number: ")
  432.  
  433. if student.startswith("23"):
  434.     print("I-ви курс")
  435. elif student.startswith("22"):
  436.     print("II-ри курс")
  437. elif student.startswith("21"):
  438.     print("III-ти курс")
  439. elif student.startswith("20"):
  440.     print("IV-ти курс")
  441. elif student.startswith("19"):
  442.     print("V-ти курс")
  443. else:
  444.     print("There is no such student number!")
  445.  
  446.  
  447. зад.4
  448.  
  449.  
  450. age=float(input("въведете възраст "))
  451. gender=input("Моля въведете пол m или f: ")
  452.  
  453. if gender=="m":
  454.     if age>=16:
  455.         print("Mr.")
  456.     else:
  457.         print("Master")
  458. elif gender=="f":
  459.     if age>=16:
  460.         print("Ms.")
  461.     else:
  462.         print("Miss")
  463. else:
  464.     print("Невалиден вход!")
  465.    
  466.  
  467. зад.5
  468.  
  469. place=input(("input place"))
  470. product=input(("Input product"))
  471. quantity=float(input("enter quantity "))
  472.  
  473.  
  474. if place=="School":
  475.     if product.lower()=="coffee":
  476.         print(quantity * 0.50)
  477.     elif product.lower()=="water":
  478.         print(quantity * 0.80)
  479.     elif product.lower()=="beer":
  480.         print(f"{(quantity * 1.20):.1f}")
  481.     elif product.lower()=="sweets":
  482.         print(f"{(quantity * 1.45):.1f}")
  483.     elif product.lower()=="peanuts":
  484.         print(quantity * 1.60)
  485.     else:
  486.         print("There is no such product!")
  487. elif place=="Dormitory":
  488.     if product.lower()=="coffee":
  489.         print(quantity * 0.40)
  490.     elif product.lower()=="water":
  491.         print(quantity * 0.70)
  492.     elif product.lower()=="beer":
  493.         print(quantity * 1.15)
  494.     elif product.lower()=="sweets":
  495.         print(quantity * 1.30)
  496.     elif product.lower()=="peanuts":
  497.         print(quantity * 1.50)
  498.     else:
  499.         print("There is no such product!")
  500. elif place=="Bus-station":
  501.     if product.lower()=="coffee":
  502.         print(quantity * 0.45)
  503.     elif product.lower()=="water":
  504.         print(quantity * 0.70)
  505.     elif product.lower()=="beer":
  506.         print(quantity * 1.10)
  507.     elif product.lower()=="sweets":
  508.         print(quantity * 1.35)
  509.     elif product.lower()=="peanuts":
  510.         print(quantity * 1.55)
  511.     else:
  512.         print("There is no such product!")
  513. else:
  514.     print("Wrong")
  515.  
  516.  
  517. зад.6
  518.  
  519. number=int(input("въведете число: "))
  520.  
  521.  
  522. if -100<=number<=100:
  523.     if number== -1 or number==0 or number==1:
  524.         print("No")
  525.     else:
  526.         print("Yes")
  527. else:
  528.     print("No")
  529.  
  530.  
  531. зад.7
  532.  
  533. hour=int(input("Въведи час "))
  534. day=input("Въведи ден ")
  535.  
  536. if day.lower() == "Неделя":
  537.     print("Затворено")
  538. elif hour>=13 and hour<15:
  539.     print("Затворено")
  540. elif hour>=7 and hour<17:
  541.     print("Отворено")
  542. else:
  543.     print("Затворено")
  544.  
  545. зад.8
  546.  
  547.  
  548. day = input("Въведете ден от седмицата: ")
  549.  
  550. if day=="Monday" or day=="Tuesday" or day=="Friday":
  551.     print("12leva")
  552. elif day=="Wednesday" or day=="Thursday":
  553.     print("14leva")
  554. elif day=="Saturday" or day == "Sunday":
  555.     print("16leva")
  556. else:
  557.     print("Невалиден ден")
  558.  
  559.  
  560.  
  561.  
  562. зад. 9
  563.  
  564. product=input("Въведете продукт: ")
  565.  
  566. if product=="banana" or product=="apple" or product=="kiwi" or product=="cherry" or product=="lemon" or product=="grapes":
  567.     print("fruit")
  568. elif product=="tomato" or product=="cucumber" or product=="pepper" or product=="carrot":
  569.     print("vegetable")
  570. else:
  571.     print("unknown")
  572.  
  573.  
  574. зад.10
  575.  
  576. number=int(input("Въведете число: "))
  577.  
  578. if 100>number or number>200 or number%2==0:
  579.     print("Invalid number")
  580. else:
  581.     print("Valid number")
  582.  
  583. зад.11
  584.  
  585.  
  586. fruit=input("Въведете плод: ")
  587. day=input("ден от седмицата: ")
  588. quantity=float(input("Въведете количество: "))
  589.  
  590. price=0
  591.  
  592. if day=='Monday' or day=='Tuesday' or day == 'Wednesday' or day=='Thursday' or day== 'Friday':
  593.     if fruit=='banana':
  594.         price=2.50
  595.     elif fruit=='apple':
  596.         price=1.20
  597.     elif fruit=='orange':
  598.         price=0.85
  599.     elif fruit=='grapefruit':
  600.         price=1.45
  601.     elif fruit=='kiwi':
  602.         price=2.70
  603.     elif fruit=='pineapple':
  604.         price=5.50
  605.     elif fruit=='grapes':
  606.         price=3.85
  607. elif day=='Saturday' or day=='Sunday':
  608.     if fruit=='banana':
  609.         price=2.70
  610.     elif fruit=='apple':
  611.         price=1.25
  612.     elif fruit=='orange':
  613.         price=0.90
  614.     elif fruit=='grapefruit':
  615.         price=1.60
  616.     elif fruit=='kiwi':
  617.         price=3.00
  618.     elif fruit=='pineapple':
  619.         price=5.60
  620.     elif fruit=='grapes':
  621.         price=4.20
  622.  
  623. if price == 0:
  624.     print('error')
  625. else:
  626.     total = price * quantity
  627.     print(f"{total:.2f}")
  628.  
  629. зад. 12 господине не можах да я направя, ако я разбера ще ви я пратя. Данните от таблицата не ги разбирам.
  630.  
  631. Nov 13/23
  632.  
  633. зад 1
  634.  
  635.  
  636. teatur=input()
  637. rows=int(input())
  638. columns=int(input())
  639.  
  640. capacity=rows*columns
  641. money=0
  642.  
  643.  
  644. if teatur=="Premiere":
  645.     money=12
  646. elif teatur=="Normal":
  647.     money=7.50
  648. elif teatur=="Discount":
  649.     money=5
  650. total_sum=capacity * money
  651.  
  652. print(f"{total_sum:.2f} leva")
  653.  
  654.  
  655. зад 2
  656.  
  657. degrees=int(input())
  658. time_of_day=input()
  659.  
  660. outfit=0
  661. shoes=0
  662.  
  663.  
  664. if degrees<=18:
  665.     if time_of_day=="Morning":
  666.         outfit="Sweatshirt"
  667.         shoes="Sneakers"
  668.     else:
  669.         outfit="Shirt"
  670.         shoes="Moccasins"
  671. elif degrees<=24:
  672.     if time_of_day=="Afternoon":
  673.         outfit="T-Shirt"
  674.         shoes="Sandals"
  675.     else:
  676.         outfit="Shirt"
  677.         shoes="Moccasins"
  678. else:
  679.     if time_of_day=="Afternoon":
  680.         outfit="Swim Suit"
  681.         shoes="Barefoot"
  682.     else:
  683.         outfit="Shirt"
  684.         shoes="Moccasins"
  685.  
  686. print(f"It's {degrees} degrees, get your {outfit} and {shoes}.")
  687.  
  688.  
  689. зад 3
  690.  
  691.  
  692. elif flower_type=="Dahlias":
  693.     price=3.80*flower_count
  694.     if flower_count>90:
  695.         price*=0.85
  696. elif flower_type=="Tulips":
  697.     price = 2.80*flower_count
  698.     if flower_count>80:
  699.         price*=0.85
  700. elif flower_type=="Narcissus":
  701.     price=3*flower_count
  702.     if flower_count < 120:
  703.         price*=1.15
  704. elif flower_type=="Gladiolus":
  705.     price = 2.50*flower_count
  706.     if flower_count<80:
  707.         price*=1.2
  708.  
  709. if budget>=price:
  710.     print(f"Hey, you have a great garden with {flower_count} {flower_type} and {budget - price:.2f} leva left.")
  711. else:
  712.     print(f"Not enough money, you need {price - budget:.2f} leva more.")
  713.  
  714.    
  715. зад 4
  716.  
  717.  
  718. budget=int(input())
  719. season=input()
  720. num_friends=int(input())
  721.  
  722. if season=="Spring":
  723.     base_price=3000
  724. elif season=="Summer" or season == "Autumn":
  725.     base_price=4200
  726. else:
  727.     base_price=2600
  728.  
  729. if num_friends<=6:
  730.     discount=0.1
  731. elif num_friends<=11:
  732.     discount=0.15
  733. else:
  734.     discount=0.25
  735.  
  736. total_price=base_price * (1 - discount)
  737.  
  738. if num_friends % 2 == 0:
  739.     if season=="Autumn":
  740.         total_price=total_price
  741.     else:
  742.         total_price*=0.95
  743.  
  744. if budget>=total_price:
  745.     print(f"Yes! You have {budget - total_price:.2f} leva left.")
  746. else:
  747.     print(f"Not enough money! You need {total_price - budget:.2f} leva.")
  748.    
  749.    
  750.  
  751. зад 5
  752.  
  753.  
  754. budget=int(input())
  755. season=input()
  756. num_friends=int(input())
  757.  
  758. if season=="Spring":
  759.     base_price=3000
  760. elif season=="Summer" or season == "Autumn":
  761.     base_price=4200
  762. else:
  763.     base_price=2600
  764.  
  765. if num_friends<=6:
  766.     discount=0.1
  767. elif num_friends<=11:
  768.     discount=0.15
  769. else:
  770.     discount=0.25
  771.  
  772. total_price=base_price*(1 - discount)
  773.  
  774. if num_friends % 2 == 0:
  775.     if season=="Autumn":
  776.         total_price=total_price
  777.     else:
  778.         total_price*=0.95
  779.  
  780. if budget>=total_price:
  781.     print(f"Yes! You have {budget - total_price:.2f} leva left.")
  782. else:
  783.     print(f"Not enough money! You need {total_price - budget:.2f} leva.")
  784.    
  785.  
  786. зад 6
  787.  
  788.  
  789. budget = float(input("Enter your budget: "))
  790. season = input("Enter the season (summer/winter): ")
  791.  
  792. destination = "0"
  793. vacation_type = "0"
  794. spent_money = 0
  795.  
  796. if budget <= 100:
  797.     destination = "Bulgaria"
  798.     if season == "summer":
  799.         vacation_type = "Camp"
  800.         spent_money = budget * 0.3
  801.     elif season == "winter":
  802.         vacation_type = "Hotel"
  803.         spent_money = budget * 0.7
  804. elif budget <= 1000:
  805.     destination = "Balkans"
  806.     if season == "summer":
  807.         vacation_type = "Camp"
  808.         spent_money = budget * 0.4
  809.     elif season == "winter":
  810.         vacation_type = "Hotel"
  811.         spent_money = budget * 0.8
  812. else:
  813.     destination = "Europe"
  814.     vacation_type = "Hotel"
  815.     spent_money = budget * 0.9
  816.  
  817. print(f"Somewhere in {destination}")
  818. print(f"{vacation_type} - {spent_money:.2f}")
  819.  
  820.  
  821.  
  822. зад 7
  823.  
  824.  
  825.  
  826. N1=int(input())
  827. N2=int(input())
  828. operator=input()
  829.  
  830. if operator=='+':
  831.     result=N1 + N2
  832.     if result % 2 == 0:
  833.         print(f"{N1} {operator} {N2}={result} - even")
  834.     else:
  835.         print(f"{N1} {operator} {N2}={result} - odd")
  836. elif operator=='-':
  837.     result = N1 - N2
  838.     if result % 2 == 0:
  839.         print(f"{N1} {operator} {N2}={result} - even")
  840.     else:
  841.         print(f"{N1} {operator} {N2}={result} - odd")
  842. elif operator=='*':
  843.     result=N1*N2
  844.     if result % 2 == 0:
  845.         print(f"{N1} {operator} {N2}={result} - even")
  846.     else:
  847.         print(f"{N1} {operator} {N2}={result} - odd")
  848. elif operator=='/':
  849.     if N2==0:
  850.         print(f"Cannot divide {N1} by zero")
  851.     else:
  852.         result=N1 / N2
  853.         print(f"{N1} / {N2} = {result:.2f}")
  854. elif operator=='%':
  855.     if N2==0:
  856.         print(f"Cannot divide {N1} by zero")
  857.     else:
  858.         result=N1 % N2
  859.         print(f"{N1} % {N2}={result}")
  860. зад 8
  861.  
  862. господине 8 ма задача не я разбирам мисля че имам представа как трябва да се направи но не съм сигурен
  863.  
  864. зад 9
  865.  
  866. days= int(input())
  867. room_type= input()
  868. rating= input()
  869. discount= 0
  870.  
  871. nights=days - 1
  872.  
  873. if room_type== "room for one person":
  874.     price= 180.00 * nights
  875.     discount= 0
  876. elif room_type== "apartment":
  877.     price= 250.00 * nights
  878.     if nights< 10:
  879.         discount= 0.3
  880.     elif 10<= nights<= 15:
  881.         discount= 0.35
  882.     else:
  883.         discount= 0.5
  884. elif room_type== "president apartment":
  885.     price=350.00 * nights
  886.     if nights<10:
  887.         discount= 0.1
  888.     elif 10<= nights<=15:
  889.         discount=0.15
  890.     else:
  891.         discount=0.2
  892.  
  893. price_after_discount = price-(price * discount)
  894.  
  895. if rating== "positive":
  896.     final_price= price_after_discount+price_after_discount * 0.25
  897. else:
  898.     final_price= price_after_discount - price_after_discount * 0.1
  899.  
  900. print(f"{final_price:.2f}")
  901.  
  902.  
  903. Nov 21
  904.  
  905. зад 1
  906.  
  907. for n in range(1, 10+1):
  908.     print(n)
  909.  
  910. зад 2
  911.  
  912. for n in range(1, 101):
  913.     print(n)
  914.  
  915.  
  916. зад 3
  917.  
  918.  
  919. for n in range(100,201):
  920.     print(n)
  921.  
  922. зад 4
  923.  
  924. num = int(input("Enter a number: "))
  925. for n in range(0, num+1):
  926.     print(n)
  927.  
  928. зад 5
  929.  
  930. num = int(input("enter a number:"))
  931. for i in range(0,num+1,5):
  932.     print(i)num = int(input("enter a number:"))
  933. for i in range(0,num+1,5):
  934.     print(i)
  935.  
  936.  
  937. зад 6
  938.  
  939. number = int(input())
  940.  
  941. for num in range(number):
  942.     print(num**num)
  943.  
  944. зад 7
  945.  
  946. number = int(input())
  947. number2 = int(input())
  948.  
  949. for num in range(number, number2 - 1, -1):
  950.     print(num)
  951.  
  952.  
  953. зад 8
  954.  
  955. text = input()
  956. for i in text:
  957.     # print(f":", end="")
  958.     # print(i, end="")
  959.     print(i, end=":")
  960.  
  961. зад 9
  962. text = input()
  963. total_sum = 0
  964.  
  965. for t in text:
  966.     if t.lower() == "a":
  967.         total_sum += 1
  968.     elif t.lower() == "e":
  969.         total_sum += 2
  970.     elif t.lower() == "i":
  971.         total_sum += 3
  972.     elif t.lower() == "o":
  973.         total_sum += 4
  974.     elif t.lower() == "u":
  975.         total_sum += 5
  976.  
  977. print(total_sum)
  978.  
  979. зад 10
  980.  
  981. number = int(input())
  982. total_sum = 0
  983.  
  984. for num in range(number):
  985.     new_number = int(input())
  986.     total_sum += new_number
  987.  
  988. print(total_sum)
  989.  
  990. зад 11
  991.  
  992.  
  993. n= int(input("Итерации: "))
  994. sum= 0
  995. for i in range(n):
  996.     число= int(input("Въведете число: "))
  997.     sum += число
  998. print("Сумата на числата е:", sum)
  999.  
  1000.  
  1001.  
  1002.  
  1003. # зад 12
  1004.  
  1005. n= int(input("Въведете броя на числата: "))
  1006.  
  1007. even_sum= 0
  1008. odd_sum= 0
  1009. for i in range(n):
  1010.     number= int(input("Въведете число "))
  1011.     if i % 2 == 0:
  1012.         even_sum += number
  1013.     else:
  1014.         odd_sum+=number
  1015.  
  1016. if even_sum == odd_sum:
  1017.     print("Yes")
  1018.     print("Sum="+str(even_sum))
  1019. else:
  1020.     print("No")
  1021.     print("Diff="+str(abs(even_sum - odd_sum)))
  1022.  
  1023.    
  1024.  #зад 13
  1025.  
  1026. Господине 13 задача не мога да я реша
  1027.  
  1028. Nov 26
  1029.  
  1030.  зад.3
  1031.  
  1032.  
  1033.  
  1034. working_days=int(input())
  1035. bike_price=float(input())
  1036.  
  1037. total_money=0
  1038. for day in range(1, working_days + 1):
  1039.     if day % 2 == 0:
  1040.         salary= 100
  1041.     else:
  1042.         salary= 150
  1043.  
  1044.     if day % 5 == 0:
  1045.         salary *= 0.8
  1046.  
  1047.     total_money += salary
  1048.     total_money -= 10  # wife's coffee money
  1049.  
  1050. if total_money >= bike_price:
  1051.     print(f"Да, и ми останаха {total_money - bike_price} лева")
  1052. else:
  1053.     print(f"Не, трябват ми още {bike_price - total_money} лева")
  1054.  
  1055.  
  1056.  
  1057. зад.4 господине не я разбирам и не мога да я направя.
  1058.  
  1059.  
  1060. Dec 9
  1061.  
  1062.  
  1063.  
  1064. зад 1
  1065.  
  1066.  
  1067. for i in range(1, 10 +1):
  1068.     print(i)
  1069.  
  1070. зад 2
  1071. for i in range(1, 10 + 1):
  1072.     print(i ** i)
  1073.  
  1074. зад 3
  1075. for i in range(1, 10 + 1):
  1076.     print(i)
  1077. print("Done!")
  1078.  
  1079.  
  1080. зад 4
  1081.  
  1082. for i in range(1, 101):
  1083.     if i % 10 == 3:
  1084.         print("*")
  1085.         continue
  1086.     print(i)
  1087.  
  1088. зад 5
  1089.  
  1090. n = int(input())
  1091.  
  1092. for i in range(n + 1):
  1093.     print(i)
  1094.  
  1095. зад 6
  1096.  
  1097. for i in range(-10, 1):
  1098.     print(i)
  1099.  
  1100. зад 7
  1101.  
  1102. total_sum = 0
  1103. for i in range(1, 100 + 1):
  1104.     total_sum += i
  1105. print(total_sum)
  1106.  
  1107. зад 8
  1108.  
  1109.  
  1110. total_sum = 0
  1111. for i in range(0, 100 + 1):
  1112.     if i % 2 == 0:
  1113.         total_sum += i
  1114. print(total_sum)
  1115.  
  1116.  
  1117. зад 9
  1118.  
  1119. total_sum = 0
  1120. for i in range(0, 100 + 1):
  1121.     if i % 2 == 1:
  1122.         total_sum += i
  1123. print(total_sum)
  1124.  
  1125. зад 10
  1126.  
  1127. n = int(input())
  1128.  
  1129. for i in range(2, n):
  1130.     if (i % n == 0):
  1131.         print(f"{n} is not prime")
  1132.         break
  1133.     else:
  1134.         print(i)
  1135.  
  1136. зад 11
  1137. text=input()
  1138. for t in text:
  1139.     print(t)
  1140.  
  1141. зад 12
  1142.  
  1143. text = input()
  1144. for t in text:
  1145.     print(t, end = ",")
  1146.  
  1147. зад 13
  1148.  
  1149. text = input()
  1150. print(text[::-1])
  1151.  
  1152. Dec 10
  1153.  
  1154. zad 1
  1155.  
  1156. while True:
  1157.     name = input()
  1158.     if name == "Stop":
  1159.         break
  1160.     print(name)
  1161.  
  1162. zad 2
  1163.  
  1164. user = input()
  1165. set_password = input()
  1166. while True:
  1167.     name = input()
  1168.     if name == user:
  1169.         password = input()
  1170.         if password == set_password:
  1171.             print("Welcome")
  1172.             break
  1173.         else:
  1174.             print("try again")
  1175.     else:
  1176.         print("try again")
  1177.  
  1178. zad 3
  1179.  
  1180. number = int(input())
  1181. total_sum = 0
  1182. new_number = int(input())
  1183. while total_sum < number:
  1184.     total_sum += new_number
  1185.     if total_sum > number:
  1186.         break
  1187.     new_number = int(input())
  1188.  
  1189. print(total_sum)
  1190.  
  1191.  
  1192. zad 4
  1193.  
  1194. N = int(input(
  1195. current_number = 1
  1196.  
  1197. while current_number <= N:
  1198.     print(current_number, end=", ")
  1199.     current_number = current_number * 2 + 1
  1200.  
  1201.  
  1202. zad 5
  1203.  
  1204. Господине, 5-та задача от това домашно не я разбирам стигам до някъде, но не става!
  1205.  
  1206.  
  1207. зад 6
  1208.  
  1209. също не мога да я разбера!
  1210.  
  1211.  
  1212.  
  1213. зад 7
  1214.  
  1215. и нея не мога да разбера! Ако ги направя ще ви ги пратя!!!
  1216.  
  1217.  
  1218.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement