Advertisement
Lyubohd

03. Mobile operator

Jun 19th, 2021
883
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.96 KB | None | 0 0
  1. contract_duration = input()
  2. contract_type = input()
  3. mobile_data = input()
  4. months_to_pay = int(input())
  5.  
  6. price = 0
  7. if contract_duration == "one":
  8.     if contract_type == "Small":
  9.         price = 9.98
  10.     elif contract_type == "Middle":
  11.         price = 18.99
  12.     elif contract_type == "Large":
  13.         price = 25.98
  14.     elif contract_type == "ExtraLarge":
  15.         price = 35.99
  16. elif contract_duration == "two":
  17.     if contract_type == "Small":
  18.         price = 8.58
  19.     elif contract_type == "Middle":
  20.         price = 17.09
  21.     elif contract_type == "Large":
  22.         price = 23.59
  23.     elif contract_type == "ExtraLarge":
  24.         price = 31.79
  25.  
  26. if mobile_data == "yes":
  27.     if price <= 10:
  28.         price += 5.5
  29.     elif price <= 30:
  30.         price += 4.35
  31.     elif price > 30:
  32.         price += 3.85
  33.  
  34. if contract_duration == "two":
  35.     price = price * 0.9625  # price - price * 0.0375
  36.  
  37. total_price = price * months_to_pay
  38. print(f"{total_price:.2f} lv.")
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement