I have two functions:
and
I want to pass the decimal values of firstNum and secondNum from userInput to the function mathAction. I've tried both positional and keywords, but I'm just not seeing something. I'm sure it's right in front of my face but I'm stumped. Yea, this is for school but this is just a small portion of my overall program. I have the rest of it working pretty good.
Code:
def userInput():
num1 = str(input("Enter a Roman numeral: ")) # get first Roman numeral input from user
firstNum = decimalTrans(num1) # pass the input to be converted
print("The first number is: ", firstNum) # print the decimal
num2 = str(input("Enter another Roman numeral: "))
secondNum = decimalTrans(num2)
print("The second number is: ", secondNum)
and
Code:
def mathAction(): # takes two inputs and performs arithmetic on them
operation = str(input("Enter your desired arithmetic operation: "))
if operation == '+':
sum = firstNum + secondNum
print("The sum is:",reConvert(sum),"(",sum,")")
elif operation == '-':
difference = firstNum - secondNum
print("The difference is",reConvert(difference),"(",difference,")")
elif operation == '*':
product = firstNum * secondNum
print("The product is",reConvert(product),"(",product,")")
elif operation == '//' or '/':
quotient = firstNum // secondNum
print("The quotient is",reConvert(quotient),"(",quotient,")")
else:
print("Enter a correct arithmetic operator.")
I want to pass the decimal values of firstNum and secondNum from userInput to the function mathAction. I've tried both positional and keywords, but I'm just not seeing something. I'm sure it's right in front of my face but I'm stumped. Yea, this is for school but this is just a small portion of my overall program. I have the rest of it working pretty good.