# 12. Trade Commissions

Apr 17th, 2021
1,248
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. # град -> text
2. # продажби -> float
3. # печалба = процент * продажби
4.
5. town = input() # Sofia, Plovdiv, Varna, other (Error)
6. sales = float(input()) #0 ≤ s ≤ 500; 500 < s ≤ 1 000; 1 000 < s ≤ 10 000; s > 10 000
7.
8. if town == "Sofia":
9.     # проверка за броя на продажбите
10.     if 0 <= sales <= 500:
11.         # 5% -> 5 / 100 = 0.05
12.         print(f"{0.05 * sales:.2f}")
13.     elif 500 < sales <= 1000:
14.         # 7% -> 0.07
15.         print(f"{0.07 * sales:.2f}")
16.     elif 1000 < sales <= 10000:
17.         # 8% -> 0.08
18.         print(f"{0.08 * sales:.2f}")
19.     elif sales > 10000:
20.         # 12% -> 0.12
21.         print(f"{0.12 * sales:.2f}")
22.     else:
23.         print("error")
24. elif town == "Plovdiv":
25.     # проверка за броя на продажбите
26.     # печалба = процент * продажбите
27.     if 0 <= sales <= 500:
28.         print(f"{0.055 * sales:.2f}")
29.     elif 500 < sales <= 1000:
30.         print(f"{0.08 * sales:.2f}")
31.     elif 1000 < sales <= 10000:
32.         print(f"{0.12 * sales:.2f}")
33.     elif sales > 10000:
34.         print(f"{0.145 * sales:.2f}")
35.     else:
36.         print("error")
37. elif town == "Varna":
38.     # проверка за броя на продажбите
39.     # печалба = процент * продажбите
40.     if 0 <= sales <= 500:
41.         print(f"{0.045 * sales:.2f}")
42.     elif 500 < sales <= 1000:
43.         print(f"{0.075 * sales:.2f}")
44.     elif 1000 < sales <= 10000:
45.         print(f"{0.1 * sales:.2f}")
46.     elif sales > 10000:
47.         print(f"{0.13 * sales:.2f}")
48.     else:
49.         print("error")
50. else:
51.     print('error')
52.
RAW Paste Data

# Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!