Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # numbers = int(input())
- # first_pair = 0
- # current_pair = 0
- # max_diff = 0
- # is_equal = False
- # for i in range(1, (numbers * 2) + 1):
- # number = int(input())
- # if i < 3:
- # first_pair += number
- # elif i > 2:
- # current_pair += number
- # if i % 2 == 0:
- # if current_pair == first_pair:
- # is_equal = True
- # first_pair = current_pair
- # current_pair = 0
- # continue
- # else:
- # is_equal = False
- # max_diff = abs(first_pair - current_pair)
- # first_pair = current_pair
- # current_pair = 0
- # if is_equal or max_diff == 0:
- # print(f'Yes, value={first_pair}')
- # else:
- # print(f'No, maxdiff={max_diff}')
- # number = int(input())
- #
- # for i in range(2, number):
- # if number % i == 0:
- # print('Not Prime')
- # break
- # else:
- # print('Prime')
- #
- # number = int(input())
- # prime = True
- # for i in range(2, number):
- # if number % i == 0:
- # prime = False
- # print('Not prime')
- # break
- # else:
- # print('Prime')
- # list_test = input().split()
- # print(list_test, type(list_test))
- # text = input()
- # len_text = len(text)
- # left_sum = 0
- # right_sum = 0
- # left_part = ''
- # right_part = ''
- # if len_text % 2 == 0:
- # left_part = text[:len_text//2]
- # right_part = text[len_text//2:]
- # else:
- # left_part = text[:len_text // 2]
- # right_part = text[len_text // 2 + 1:]
- # for i in range(len(left_part)):
- # left_sum += ord(left_part[i])
- # right_sum += ord(right_part[i])
- #
- # if left_sum >= right_sum:
- # print(f'Left part wins with {left_sum} points vs {right_sum} points')
- # else:
- # print(f'Right part sum wins with {right_sum} points vs {left_sum} points')
- # text = input()
- #
- # index_list = []
- #
- # for index in range(len(text)):
- # current_char = text[index]
- # if current_char.isalpha():
- # if current_char == current_char.upper():
- # index_list.append(index)
- #
- # print(index_list)
- # string = input()
- # str_list = []
- # output = []
- # for letter in string:
- # str_list.append(letter)
- # for position in range(0, len(string)):
- # if str_list[position].isupper():
- # output.append(position)
- # print(output)
- # string = input()
- # for char in string:
- # if char.isdigit():
- # print('Number')
- # elif char.isalpha():
- # print('Letter')
- # else:
- # print('Special symbol')
- # if '#' not in string and \
- # '$' not in string \
- # and '&' not in string:
- town = input()
- sales_volume = float(input())
- profit = 0
- if town == "Sofia":
- if 0 <= sales_volume <= 500:
- profit = sales_volume * 0.05
- elif 500 < sales_volume <= 1000:
- profit = sales_volume * 0.07
- elif 1000 < sales_volume <= 10000:
- profit = sales_volume * 0.08
- elif sales_volume > 10000:
- profit = sales_volume * 0.12
- elif town == "Varna":
- if 0 <= sales_volume <= 500:
- profit = sales_volume * 0.045
- elif 500 < sales_volume <= 1000:
- profit = sales_volume * 0.075
- elif 1000 < sales_volume <= 10000:
- profit = sales_volume * 0.10
- elif sales_volume > 10000:
- profit = sales_volume * 0.13
- elif town == "Plovdiv":
- if 0 <= sales_volume <= 500:
- profit = sales_volume * 0.055
- elif 500 < sales_volume <= 1000:
- profit = sales_volume * 0.08
- elif 1000 < sales_volume <= 10000:
- profit = sales_volume * 0.12
- elif sales_volume > 10000:
- profit = sales_volume * 0.145
- if profit <= 0:
- print('error')
- else:
- print(f"{profit:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment