Advertisement
ipetkov

Data Types, Variables and Simple Operations - Lab

Jan 29th, 2025
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.36 KB | None | 0 0
  1. #1
  2.  
  3. print("Hello SoftUni")
  4.  
  5.  
  6. #2
  7.  
  8. print(1)
  9. print(2)
  10. print(3)
  11. print(4)
  12. print(5)
  13. print(6)
  14. print(7)
  15. print(8)
  16. print(9)
  17. print(10)
  18.  
  19. #3
  20.  
  21. side_a = int(input())
  22. side_b = int(input())
  23. area = side_a * side_b
  24. print(area)
  25.  
  26. #4
  27.  
  28. inches = float(input())
  29. centimeters = inches * 2.54
  30. print(centimeters)
  31.  
  32. #5.1
  33.  
  34. name = input()
  35. print("Hello, " + name + "!")
  36.  
  37. #5.2
  38. name = input()
  39. print(f"Hello, {name}!")
  40.  
  41. #6
  42. first_name = input()
  43. last_name = input()
  44. age = int(input())
  45. town = input()
  46.  
  47. print(f"You are {first_name} {last_name}, a {age}-years old person from {town}.")
  48.  
  49. #7
  50.  
  51. architect_name = input()
  52. number_of_projects = int(input())
  53. hours_needed = number_of_projects * 3
  54.  
  55. print(f"The architect {architect_name} will need {hours_needed} hours to complete {number_of_projects} project/s.")  
  56.  
  57. #8
  58. number_of_dog_food = int(input())
  59. number_of_cat_food = int(input())
  60. total_cost = number_of_dog_food * 2.50 + number_of_cat_food * 4
  61. print(f"{total_cost} lv.")
  62.  
  63.  
  64. #9
  65.  
  66. price_per_square_meter = 7.61
  67. discount_percentage = 0.18
  68. area = float(input("Area: "))
  69. total_cost_before_discount = area * price_per_square_meter
  70. discount_amount = total_cost_before_discount * discount_percentage
  71. final_cost = total_cost_before_discount - discount_amount
  72. print(f"The final price is: {final_cost:.2f} lv.")
  73. print(f"The discount is: {discount_amount:.2f} lv.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement