Advertisement
Dimitar23308

Untitled

Nov 11th, 2023 (edited)
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.56 KB | None | 0 0
  1. зад.1
  2.  
  3.  
  4. number = int(input())
  5.  
  6. if number == 1:
  7.     print("Monday")
  8. elif number==2:
  9.     print("Tuesday")
  10. elif number==3:
  11.     print("Wednesday")
  12. elif number==4:
  13.     print("Thursday")
  14. elif number==5:
  15.     print("Friday")
  16. elif number==6:
  17.     print("Saturday")
  18. elif number==7:
  19.     print("Sunday")
  20. else:
  21.     print("Wrong number!")
  22.  
  23. зад.2
  24.  
  25. day=input("Въведете ден:")
  26.  
  27. if day == "Monday":
  28.  print("Study day")
  29. elif day == "Tuesday":
  30.  print("Study day")
  31. elif day == "Wednesday":
  32.  print("Study day")
  33. elif day == "Thursday":
  34.  print("Study day")
  35. elif day == "Friday":
  36.  print("Study day")
  37. elif day == "Saturday":
  38.  print("Weekend")
  39. elif day == "Sunday":
  40.  print("Weekend")
  41. else:
  42.     print("Wrong day")
  43.  
  44. зад.3
  45.  
  46.  
  47. student_number = input("Enter a student number: ")
  48.  
  49. if student.startswith("23"):
  50.     print("I-ви курс")
  51. elif student.startswith("22"):
  52.     print("II-ри курс")
  53. elif student.startswith("21"):
  54.     print("III-ти курс")
  55. elif student.startswith("20"):
  56.     print("IV-ти курс")
  57. elif student.startswith("19"):
  58.     print("V-ти курс")
  59. else:
  60.     print("There is no such student number!")
  61.  
  62.  
  63. зад.4
  64.  
  65.  
  66. age=float(input("въведете възраст "))
  67. gender=input("Моля въведете пол m или f: ")
  68.  
  69. if gender=="m":
  70.     if age>=16:
  71.         print("Mr.")
  72.     else:
  73.         print("Master")
  74. elif gender=="f":
  75.     if age>=16:
  76.         print("Ms.")
  77.     else:
  78.         print("Miss")
  79. else:
  80.     print("Невалиден вход!")
  81.    
  82.  
  83. зад.5
  84.  
  85. place=input(("input place"))
  86. product=input(("Input product"))
  87. quantity=float(input("enter quantity "))
  88.  
  89.  
  90. if place=="School":
  91.     if product.lower()=="coffee":
  92.         print(quantity * 0.50)
  93.     elif product.lower()=="water":
  94.         print(quantity * 0.80)
  95.     elif product.lower()=="beer":
  96.         print(f"{(quantity * 1.20):.1f}")
  97.     elif product.lower()=="sweets":
  98.         print(f"{(quantity * 1.45):.1f}")
  99.     elif product.lower()=="peanuts":
  100.         print(quantity * 1.60)
  101.     else:
  102.         print("There is no such product!")
  103. elif place=="Dormitory":
  104.     if product.lower()=="coffee":
  105.         print(quantity * 0.40)
  106.     elif product.lower()=="water":
  107.         print(quantity * 0.70)
  108.     elif product.lower()=="beer":
  109.         print(quantity * 1.15)
  110.     elif product.lower()=="sweets":
  111.         print(quantity * 1.30)
  112.     elif product.lower()=="peanuts":
  113.         print(quantity * 1.50)
  114.     else:
  115.         print("There is no such product!")
  116. elif place=="Bus-station":
  117.     if product.lower()=="coffee":
  118.         print(quantity * 0.45)
  119.     elif product.lower()=="water":
  120.         print(quantity * 0.70)
  121.     elif product.lower()=="beer":
  122.         print(quantity * 1.10)
  123.     elif product.lower()=="sweets":
  124.         print(quantity * 1.35)
  125.     elif product.lower()=="peanuts":
  126.         print(quantity * 1.55)
  127.     else:
  128.         print("There is no such product!")
  129. else:
  130.     print("Wrong")
  131.  
  132.  
  133. зад.6
  134.  
  135. number=int(input("въведете число: "))
  136.  
  137.  
  138. if -100<=number<=100:
  139.     if number== -1 or number==0 or number==1:
  140.         print("No")
  141.     else:
  142.         print("Yes")
  143. else:
  144.     print("No")
  145.  
  146.  
  147. зад.7
  148.  
  149. hour=int(input("Въведи час "))
  150. day=input("Въведи ден ")
  151.  
  152. if day.lower() == "Неделя":
  153.     print("Затворено")
  154. elif hour>=13 and hour<15:
  155.     print("Затворено")
  156. elif hour>=7 and hour<17:
  157.     print("Отворено")
  158. else:
  159.     print("Затворено")
  160.  
  161. зад.8
  162.  
  163.  
  164. day = input("Въведете ден от седмицата: ")
  165.  
  166. if day=="Monday" or day=="Tuesday" or day=="Friday":
  167.     print("12leva")
  168. elif day=="Wednesday" or day=="Thursday":
  169.     print("14leva")
  170. elif day=="Saturday" or day == "Sunday":
  171.     print("16leva")
  172. else:
  173.     print("Невалиден ден")
  174.  
  175.  
  176.  
  177.  
  178. зад. 9
  179.  
  180. product=input("Въведете продукт: ")
  181.  
  182. if product=="banana" or product=="apple" or product=="kiwi" or product=="cherry" or product=="lemon" or product=="grapes":
  183.     print("fruit")
  184. elif product=="tomato" or product=="cucumber" or product=="pepper" or product=="carrot":
  185.     print("vegetable")
  186. else:
  187.     print("unknown")
  188.  
  189.  
  190. зад.10
  191.  
  192. number=int(input("Въведете число: "))
  193.  
  194. if 100>number or number>200 or number%2==0:
  195.     print("Invalid number")
  196. else:
  197.     print("Valid number")
  198.  
  199. зад.11
  200.  
  201.  
  202. fruit=input("Въведете плод: ")
  203. day=input("ден от седмицата: ")
  204. quantity=float(input("Въведете количество: "))
  205.  
  206. price=0
  207.  
  208. if day=='Monday' or day=='Tuesday' or day == 'Wednesday' or day=='Thursday' or day== 'Friday':
  209.     if fruit=='banana':
  210.         price=2.50
  211.     elif fruit=='apple':
  212.         price=1.20
  213.     elif fruit=='orange':
  214.         price=0.85
  215.     elif fruit=='grapefruit':
  216.         price=1.45
  217.     elif fruit=='kiwi':
  218.         price=2.70
  219.     elif fruit=='pineapple':
  220.         price=5.50
  221.     elif fruit=='grapes':
  222.         price=3.85
  223. elif day=='Saturday' or day=='Sunday':
  224.     if fruit=='banana':
  225.         price=2.70
  226.     elif fruit=='apple':
  227.         price=1.25
  228.     elif fruit=='orange':
  229.         price=0.90
  230.     elif fruit=='grapefruit':
  231.         price=1.60
  232.     elif fruit=='kiwi':
  233.         price=3.00
  234.     elif fruit=='pineapple':
  235.         price=5.60
  236.     elif fruit=='grapes':
  237.         price=4.20
  238.  
  239. if price == 0:
  240.     print('error')
  241. else:
  242.     total = price * quantity
  243.     print(f"{total:.2f}")
  244.  
  245.  
  246.  
  247. зад. 12 господине не можах да я направя, ако я разбера ще ви я пратя. Данните от таблицата не ги разбирам.
  248.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement