How to handle input() within functions in Python
I have the following code snippet: while True: print("Enter 'a' to add two numbers") ... user_input = raw_input('Users Choice: ') #I'm using py2 so raw_input works here def getNumbers(): print('Enter first number') num1 = input() print('Enter second number') num2 = input() ... if user_input == 'a': getNumbers() num3 = str(num1 + num2) print('The answer is: ' + num3 + '\n\n') The function is meant to take in an input from the user then the following code is meant to combine num1 and num2 into a solution. Anybody know what I did wrong? (Also if your looking for the rest of the code, it's just a simple calculator. I'm worried about functions that can handle input and if that's even possible)