Sichanov

trade

May 25th, 2021
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.69 KB | None | 0 0
  1. # numbers = int(input())
  2. # first_pair = 0
  3. # current_pair = 0
  4. # max_diff = 0
  5. # is_equal = False
  6. # for i in range(1, (numbers * 2) + 1):
  7. #     number = int(input())
  8. #     if i < 3:
  9. #         first_pair += number
  10. #     elif i > 2:
  11. #         current_pair += number
  12. #         if i % 2 == 0:
  13. #             if current_pair == first_pair:
  14. #                 is_equal = True
  15. #                 first_pair = current_pair
  16. #                 current_pair = 0
  17. #                 continue
  18. #             else:
  19. #                 is_equal = False
  20. #                 max_diff = abs(first_pair - current_pair)
  21. #                 first_pair = current_pair
  22. #                 current_pair = 0
  23. # if is_equal or max_diff == 0:
  24. #     print(f'Yes, value={first_pair}')
  25. # else:
  26. #     print(f'No, maxdiff={max_diff}')
  27.  
  28. # number = int(input())
  29. #
  30. # for i in range(2, number):
  31. #     if number % i == 0:
  32. #         print('Not Prime')
  33. #         break
  34. # else:
  35. #     print('Prime')
  36. #
  37. # number = int(input())
  38. # prime = True
  39. # for i in range(2, number):
  40. #     if number % i == 0:
  41. #         prime = False
  42. #         print('Not prime')
  43. #         break
  44. # else:
  45. #     print('Prime')
  46.  
  47. # list_test = input().split()
  48. # print(list_test, type(list_test))
  49.  
  50. # text = input()
  51. # len_text = len(text)
  52. # left_sum = 0
  53. # right_sum = 0
  54. # left_part = ''
  55. # right_part = ''
  56. # if len_text % 2 == 0:
  57. #     left_part = text[:len_text//2]
  58. #     right_part = text[len_text//2:]
  59. # else:
  60. #     left_part = text[:len_text // 2]
  61. #     right_part = text[len_text // 2 + 1:]
  62. # for i in range(len(left_part)):
  63. #     left_sum += ord(left_part[i])
  64. #     right_sum += ord(right_part[i])
  65. #
  66. # if left_sum >= right_sum:
  67. #     print(f'Left part wins with {left_sum} points vs {right_sum} points')
  68. # else:
  69. #     print(f'Right part sum wins with {right_sum} points vs {left_sum} points')
  70.  
  71.  
  72. # text = input()
  73. #
  74. # index_list = []
  75. #
  76. # for index in range(len(text)):
  77. #     current_char = text[index]
  78. #     if current_char.isalpha():
  79. #         if current_char == current_char.upper():
  80. #             index_list.append(index)
  81. #
  82. # print(index_list)
  83.  
  84. # string = input()
  85. # str_list = []
  86. # output = []
  87. # for letter in string:
  88. #     str_list.append(letter)
  89. # for position in range(0, len(string)):
  90. #     if str_list[position].isupper():
  91. #         output.append(position)
  92. # print(output)
  93.  
  94. # string = input()
  95. # for char in string:
  96. #     if char.isdigit():
  97. #         print('Number')
  98. #     elif char.isalpha():
  99. #         print('Letter')
  100. #     else:
  101. #         print('Special symbol')
  102.  
  103. # if '#' not in string and \
  104. #         '$' not in string \
  105. #         and '&' not in string:
  106.  
  107. town = input()
  108. sales_volume = float(input())
  109. profit = 0
  110. if town == "Sofia":
  111.     if 0 <= sales_volume <= 500:
  112.         profit = sales_volume * 0.05
  113.     elif 500 < sales_volume <= 1000:
  114.         profit = sales_volume * 0.07
  115.     elif 1000 < sales_volume <= 10000:
  116.         profit = sales_volume * 0.08
  117.     elif sales_volume > 10000:
  118.         profit = sales_volume * 0.12
  119.  
  120. elif town == "Varna":
  121.     if 0 <= sales_volume <= 500:
  122.         profit = sales_volume * 0.045
  123.     elif 500 < sales_volume <= 1000:
  124.         profit = sales_volume * 0.075
  125.     elif 1000 < sales_volume <= 10000:
  126.         profit = sales_volume * 0.10
  127.     elif sales_volume > 10000:
  128.         profit = sales_volume * 0.13
  129.  
  130. elif town == "Plovdiv":
  131.     if 0 <= sales_volume <= 500:
  132.         profit = sales_volume * 0.055
  133.     elif 500 < sales_volume <= 1000:
  134.         profit = sales_volume * 0.08
  135.     elif 1000 < sales_volume <= 10000:
  136.         profit = sales_volume * 0.12
  137.     elif sales_volume > 10000:
  138.         profit = sales_volume * 0.145
  139.  
  140. if profit <= 0:
  141.     print('error')
  142. else:
  143.     print(f"{profit:.2f}")
  144.  
Advertisement
Add Comment
Please, Sign In to add comment