Just something I'm doing at home
Line 13 SyntaxError: 'return' outside function
I am trying to return the final number for an addition
print "Hello and welcome to Alfie's calculator Alpha Version One Point Oh" first_num = int(raw_input("What is your first number?")) print "Please use 'add' or 'subtract'" operation = (raw_input("Write the operation you would like to use.")) second_num = int(raw_input("What is your second number?")) final_num_add = first_num + second_num final_num_subtract = first_num - second_num if len(first_num) > 0 and not first_num.isalpha() and len(operation) > 0 and not operation.isalpha() and len(second_num) > 0 and not second_num.isalpha(): if operation == add: return final_num_add elif operation == subtract: return final_num_subtract else: return "error: wrong operation input" else: return "error: incorrect characters for num input"