Hello fellow coders!

Here is my situation: I have to create a calculator and so far all of my IF statements are working except for the last one. I’m not sure why it goes into the one before it but I would appreciate some help as I have been trying to do this for a few hours now.

Whenever I type “E” it does the operations for “D”. All of the other operations work except for this one and I am unsure why. Please help and thank you in advance!

def menu():

print(“**")**”)

print(" Welcome to the Calculator Project!!!")

print("

```
print("A.) Addition")
print("B.) Subtraction")
print("C.) Multiplication")
print("D.) Division")
print("E.) Roots (only positive numbers)")
print("F.) Power (only positive numbers)")
print("G.) Percentage")
print("H.) Least Common Multiplier")
print("I.) Greatest Common Divisor")
print("J.) Modulus")
print("K.) Display Function Execution*")
print("L.) Quit")
print("____________________________________________________________________________________________________")
print("Please select an operation. Type quit to quit ")
```

def addition (first, second):

sum= first + second

return sum;

def subtraction (first, sec):

diff = first - sec

return diff

def multiplication (first, second):

prod = first * second

return prod

def division (first, sec):

quot = first / sec

return quot

def power(x, n):

numProduct = 1.0

while i < n:

numProduct *= x

i=i+1

return numProduct

def root(roots, index):

low = 0.0

high = roots

mid = (low + high) / 2

if (power(mid, index) > roots):

high = mid

else:

low = mid

mid = (low + high) / 2

tp = (power(mid, index) - roots)

if (tp < 0):

tp = -tp

return mid

def GCD(a, b):

while (a != b):

if (a > b):

a -= b

else:

b -= a

return a

def LCM(a,b):

f= ((a * b) / GCD(a, b))

return f

def displayFunctionExecution():

if addition(first, second) is True:

```
return "Go team!"
```

menu()

userInput = input()

while (userInput != “quit”):

```
if userInput is "A" or userInput is 'a':
print("Enter your first number")
firstNum = float(input())
print("Enter second number")
secondNum = float(input())
print("Operation: %f + %f = " % (firstNum, secondNum), end='')
print(addition(firstNum, secondNum))
print(displayFunctionExecution())
elif userInput is "B" or userInput is "b":
print("Enter your first number")
num1 = float(input())
print("Enter the second number")
num2= float(input())
print("Operation: %f - %f = " % (num1, num2), end="")
print(subtraction(num1,num2))
elif userInput is "C" or userInput is "c":
print("Enter the first number")
nums1 = float(input())
print("Enter second number")
nums2 = float(input())
print("Operation: %f * %f = " % (nums1, nums2), end="")
print(multiplication(nums1,nums2))
elif userInput is "D" or "d":
print("Enter first number")
div1 = float(input())
print("Enter your second number")
div2= float(input())
print("Operation: %f / %f = " % (div1, div2), end="")
print(division(div1,div2))
elif userInput is "E" or "e":
print("Enter the first number")
n1 = float(input())
while(n1 < 0):
print("Error: Enter only positive numbers!")
n1= float(input())
print("Enter the second number")
n2 = float(input())
while(n2 <0):
print("Error: Enter only positive numbers!")
n2= float(input())
print("Operation: %f root %f = " % (n1, n2), end="")
print(root(n1, n2))
elif userInput is "F" or "f":
print("Enter the first number")
p1 = float(input())
while(p1 < 0):
print("Error: Enter only positive numbers!")
p1= float(input())
print("Enter the second number")
p2 = float(input())
while(p2 <0):
print("Error: Enter only positive numbers!")
p2= float(input())
print("Operation: %f to the power of %f = " % (p1, p2), end="")
print(power(p1, p2))
menu()
userInput = input()
```