Making a simple calculator in PyCharm or Python :D

Sdílet
Vložit
  • čas přidán 23. 08. 2021
  • Hi guys, thank you so much for. I will really appreciate it if you like and subscribe. Thanks!
    Here's the code for the calculator :D
    num1 = float(input("Enter number: "))
    op = input("Enter Operator: ")
    num2 = float(input("Enter second number: "))
    if op == "+":
    print(num1 + num2)
    elif op == "-":
    print(num1 - num2)
    elif op == "/":
    print(num1 / num2)
    elif op == "*":
    print(num1 * num2)
    else:
    print("Invalid Operator")

Komentáře • 9