Advertisement
a1t0rmenta

python - stupid calc

Apr 25th, 2024
861
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. # STUPID CALC
  2. creator_name = "Aitor"
  3. print(f"\nSTUPID CALC made by {creator_name}\n")
  4.  
  5. print("<1> ENHANCE")
  6. print("<2> ADD")
  7. print("<3> SUBSTRACT")
  8. print("<4> MULTIPLY")
  9. print("<5> DIVIDE")
  10.  
  11. answer = input("\nChoose option:\n")
  12.  
  13.  
  14. def input_numbers():
  15.     print("Introduce el primer valor:")
  16.     value1 = float(input())
  17.     print("Introduce el segundo valor:")
  18.     value2 = float(input())
  19.     return (value1, value2)
  20.  
  21.  
  22. if answer == "1":
  23.     value1, value2 = input_numbers()
  24.     result = value1 ** value2
  25.     print(result)
  26.  
  27. if answer == "2":
  28.     value1, value2 = input_numbers()
  29.     print(value1 + value2)
  30.  
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement