Feb-27-2019, 06:02 AM
Hello, my class just began functions() and defining them but I'm stuck rn.
def greeting(): print("Hello, welcome to the Calculator App") def menu(): decide=input("1 for Addition, 2 for Subtraction, 3 for Multiplication, 4 for Division") def num(): num1=input("Enter first value") num2=input("Enter second value") def calc(): if decide == "1": ans = num1 + num2 print(ans) if decide == "2": ans2 = num1 - num2 print(ans2) if decide == "3": ans3 = num1 * num2 print(ans3) if decide == "4": ans4 = num1 / num2 print(ans4) greeting() menu() num() calc()When I run this part of code, it yields a "decide" is not defined. I'm not sure what to do as to fix this. Also, I'm confused as to what the parenthesis next to a function should contain, what could and should be added inside the parenthesis?