Advertisement
stiky_fingaz

Mobile Operators

May 23rd, 2024
548
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.63 KB | None | 0 0
  1. call_cost = float(input("Enter the cost of the call: "))
  2. outgoing_operator = input("Choose outgoing operator (operator1, operator2, or operator3): ")
  3. incoming_operator = input("Choose incoming operator (operator1, operator2, or operator3): ")
  4.  
  5. cost_per_minute_operator1_outgoing = 0.2
  6. cost_per_minute_operator2_outgoing = 0.3
  7. cost_per_minute_operator3_outgoing = 0.4
  8. cost_per_minute_operator1_incoming = 0.05
  9. cost_per_minute_operator2_incoming = 0.06
  10. cost_per_minute_operator3_incoming = 0.07
  11. outgoing_cost_operator1 = cost_per_minute_operator1_outgoing * call_cost
  12. outgoing_cost_operator2 = cost_per_minute_operator2_outgoing * call_cost
  13. outgoing_cost_operator3 = cost_per_minute_operator3_outgoing * call_cost
  14. incoming_cost_operator1 = cost_per_minute_operator1_incoming * call_cost
  15. incoming_cost_operator2 = cost_per_minute_operator2_incoming * call_cost
  16. incoming_cost_operator3 = cost_per_minute_operator3_incoming * call_cost
  17.  
  18. if outgoing_operator == "1":
  19.     print(f"{outgoing_cost_operator1}")
  20. elif outgoing_operator == "2":
  21.     print(f"{outgoing_cost_operator2}")
  22. elif outgoing_operator == "3":
  23.     print(f"{outgoing_cost_operator3}")
  24. else:
  25.     print("Error")
  26.  
  27. if incoming_operator == "1":
  28.     print(f"{incoming_cost_operator1}")
  29. elif incoming_operator == "2":
  30.     print(f"{incoming_cost_operator2}")
  31. elif incoming_operator == "3":
  32.     print(f"{incoming_cost_operator3}")
  33. else:
  34.     print("Error")
  35.  
  36. total_cost = (outgoing_cost_operator1 or outgoing_cost_operator2 or outgoing_cost_operator3) +\
  37. (incoming_cost_operator1 or incoming_cost_operator2 or incoming_cost_operator3)
  38. print(f"The total cost of the call is: {total_cost}")
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement