Advertisement
ipetkov

Data Types, Variables and Simple Operations - Exercise

Jan 29th, 2025
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.91 KB | None | 0 0
  1. #1
  2.  
  3. usd_to_bgn_rate = 1.79549
  4. usd_amount = float(input("Enter the amount in USD: "))
  5. bgn_amount = usd_amount * usd_to_bgn_rate
  6. print(bgn_amount)
  7.  
  8. #2
  9.  
  10. import math
  11.  
  12. radians = float(input())
  13. degrees = radians * 180 / math.pi
  14.  
  15. print(degrees)
  16.  
  17. #3
  18.  
  19. deposited_amount = float(input())
  20. term_of_deposit = int(input())
  21. annual_interest_rate = float(input())
  22.  
  23. amount = deposited_amount + term_of_deposit * (deposited_amount * (annual_interest_rate / 100)) / 12
  24.  
  25. print(amount)
  26.  
  27. #4
  28.  
  29. total_pages = int(input())
  30. pages_per_hour = int(input())
  31. days_to_finish = int(input())
  32.  
  33. total_hours_needed = total_pages / pages_per_hour
  34.  
  35. hours_per_day = total_hours_needed / days_to_finish
  36.  
  37. print(round(hours_per_day))
  38.  
  39. #5
  40.  
  41. pens_price_per_pack = 5.80
  42. markers_price_per_pack = 7.20
  43. board_cleaner_price_per_liter = 1.20
  44.  
  45. num_pens_packs = int(input())
  46. num_markers_packs = int(input())
  47. liters_board_cleaner = int(input())
  48. discount_percentage = int(input())
  49.  
  50.  
  51. total_price = (num_pens_packs * pens_price_per_pack) + (num_markers_packs * markers_price_per_pack) + (liters_board_cleaner * board_cleaner_price_per_liter)
  52. discount_amount = total_price * (discount_percentage / 100)
  53. final_price = total_price - discount_amount
  54. print(final_price)
  55.  
  56. #6
  57.  
  58. nylon_needed = int(input())
  59. paint_needed = int(input())
  60. thinner_needed = int(input())
  61. work_hours = int(input())
  62.  
  63. nylon_cost = nylon_needed * 1.50
  64. paint_cost = paint_needed * 14.50
  65. thinner_cost = thinner_needed * 5.00
  66. extra_nylon_cost = 2 * 1.50
  67. extra_paint_cost = paint_needed * 0.1 * 14.50
  68. bags_cost = 0.40
  69.  
  70. material_cost = nylon_cost + paint_cost + thinner_cost + extra_nylon_cost + extra_paint_cost + bags_cost
  71. craftsmen_cost = material_cost * 0.3 * work_hours
  72. total_cost = material_cost + craftsmen_cost
  73.  
  74. print(total_cost)
  75.  
  76. #7
  77.  
  78. chicken_menu_price = 10.35
  79. fish_menu_price = 12.40
  80. vegetarian_menu_price = 8.15
  81. delivery_price = 2.50
  82.  
  83. num_chicken_menus = int(input())
  84. num_fish_menus = int(input())
  85. num_vegetarian_menus = int(input())
  86.  
  87. total_menu_price = (num_chicken_menus * chicken_menu_price) + (num_fish_menus * fish_menu_price) + (num_vegetarian_menus * vegetarian_menu_price)
  88. dessert_price = 0.20 * total_menu_price
  89. total_order_price = total_menu_price + dessert_price + delivery_price
  90.  
  91. print(total_order_price)
  92.  
  93. #8
  94.  
  95. training_fee = int(input())
  96.  
  97. sneakers_price = training_fee * 0.60
  98. basketball_team_price = sneakers_price * 0.80
  99. basketball_price = basketball_team_price / 4
  100. accessories_price = basketball_price / 5
  101. total_expenses = training_fee + sneakers_price + basketball_team_price + basketball_price + accessories_price
  102.  
  103. print(total_expenses)
  104.  
  105. #9
  106.  
  107. length = int(input())
  108. width = int(input())
  109. height = int(input())
  110. percentage = float(input())
  111.  
  112. # volume_dm3 = (length / 10) * (width / 10) * (height / 10)
  113. volume_dm3 = length * width * height / 1000
  114.  
  115. water_volume = volume_dm3 * (1 - (percentage / 100))
  116.  
  117. print(f"{water_volume:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement