I'm trying to code a very simple calculator in python. The problem is it works perfectly when I give positive numbers but I don't get any answer when I enter negative numbers... I can't figure out why. I would really appreciate it if someone could help me :). Here's my code:
print("Hi :) This is your simple calculator") a = float(input("please enter the first number: ")) b = float(input("please enter the second number: ")) print(f"{a}+{b} is {round((a)+(b), 3)}, {a}-{b} is {round(a-(b), 3)}, {b}-{a} is {round(b-(a), 3)}, {a}*{b} is {round(a*(b), 3)}, {a}/{b} is {round(a/(b), 3 )}, {b}/{a} is {round(b/(a), 3)}, {a} to the power of {b} is {round((a)**(b), 3)}, {b}to the power of{a} is {round((b)**(a), 3)}, {b} root of {a} is {round((a)**(1/b), 3)}, {a} root of {b} is {round((b)**(1/a), 3)} ")