Python : Simple Calculator
15 July 2024 at 16:35
Today I learned about doing simple calculator arithmetic operations,
IF... ELSE... ELIF... statement and WHILE loop.
Also one learner asked about
num1 = input("Enter First number : ")
choice = input("Enter the Choice : ")
num2 = input("Enter Second number : ")
print ((num1)(choice)(num2)) # expected to print 9 for the input 4 + 5
This will Error out. But still possible to get result using eval.
print(eval(num1+choice+num2))