Advertisement
veronikaaa86

First Steps In Coding Exercises Python

Feb 27th, 2022 (edited)
918
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.55 KB | None | 0 0
  1. 01. USD to BGN
  2.  
  3. usd = float(input())
  4.  
  5. bgn = usd * 1.79549
  6.  
  7. print(bgn)
  8. ===========================================================
  9. 02. Radians to Degrees
  10.  
  11. from math import pi
  12.  
  13. rad = float(input())
  14.  
  15. # градус = радиан * 180 / π
  16. degrees = rad * 180 /pi
  17.  
  18. print(degrees)
  19. =============================================================================================
  20. 03. Deposit Calculator
  21.  
  22. deposit_amount = float(input())
  23. months = int(input())
  24. annual_rate = float(input())
  25.  
  26. # сума = депозирана сума + срок на депозита * ((депозирана сума * годишен лихвен процент ) / 12)
  27. # result = deposit_amount + months * ((deposit_amount * annual_rate) / 12)
  28.  
  29. per_year = deposit_amount * (annual_rate / 100)
  30. per_month = per_year / 12
  31. total_sum = deposit_amount + (months * per_month)
  32.  
  33. print(total_sum)
  34. ===========================================================================================================
  35. 04. Vacation books list
  36.  
  37. total_count_pages = int(input())
  38. pages_hour = int(input())
  39. days = int(input())
  40.  
  41. total_hours = total_count_pages // pages_hour
  42.  
  43. hours_per_day = total_hours // days
  44.  
  45. print(hours_per_day)
  46. ===========================================================================================================
  47. 05. Supplies for School
  48.  
  49. pens_count = int(input())
  50. markers_count = int(input())
  51. detergent_lt = int(input())
  52. percent_discount = int(input())
  53.  
  54. price_pens = pens_count * 5.80
  55. price_markers = markers_count * 7.20
  56. price_detergent = detergent_lt * 1.20
  57.  
  58. total_price = price_pens + price_markers + price_detergent
  59.  
  60. discount = total_price * (percent_discount / 100)
  61. price_with_discount = total_price - discount
  62.  
  63. print(price_with_discount)
  64. ===========================================================================================================
  65. 06. Repainting
  66.  
  67. nylon = int(input())
  68. paint = int(input())
  69. razr = int(input())
  70. hours_workers = int(input())
  71.  
  72. price_nylon = (nylon + 2) * 1.5
  73. price_paint = (paint * 1.10) * 14.5
  74. price_razr = razr * 5
  75.  
  76. sum_materials = price_nylon + price_paint + price_razr + 0.40
  77. sum_workers = (sum_materials * 0.30) * hours_workers
  78. total_sum = sum_materials + sum_workers
  79.  
  80. print(total_sum)
  81. ===========================================================================================================
  82. 07. Food Delivery
  83.  
  84. chicken_menu_count = int(input())
  85. fish_menu_count = int(input())
  86. veg_menu_count = int(input())
  87.  
  88. price_chicken_menu = chicken_menu_count * 10.35
  89. price_fish_menu = fish_menu_count * 12.4
  90. price_veg_menu = veg_menu_count * 8.15
  91.  
  92. all_menu_sum = price_chicken_menu + price_fish_menu + price_veg_menu
  93.  
  94. dessert = all_menu_sum * 0.20
  95. total_sum = all_menu_sum + dessert + 2.5
  96.  
  97. print(total_sum)
  98. ===========================================================================================================
  99. 08. Basketball Equipment
  100.  
  101. year_tax = int(input())
  102.  
  103. shoes = year_tax * 0.60
  104. suit = shoes * 0.80
  105. ball = suit / 4
  106. acc = ball / 5
  107.  
  108. total_sum = shoes + suit + ball + acc + year_tax
  109.  
  110. print(total_sum)
  111. ===========================================================================================================
  112. 09. Fish Tank
  113.  
  114. length = int(input())
  115. width = int(input())
  116. height = int(input())
  117. percent = float(input())
  118.  
  119. volume = length * width * height
  120.  
  121. total_litres = volume / 1000
  122.  
  123. percent_lt = total_litres * (percent / 100)
  124. needed_litres = total_litres - percent_lt
  125.  
  126. print(needed_litres)
  127. ===========================================================================================================
  128.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement