#!/usr/bin/env python operators = ['+', '-', '/', '*'] while True: print 'Which operator do you want? (Enter any other number to quit)' for op in operators: print "%i: %s" % (operators.index(op), op) use = int(raw_input('Which operator do you want? ')) if use > len(operators): break first = float(raw_input('Enter your first number: ')) second = float(raw_input('Enter your second number: ')) print 'Your answer is: ', if operators[use] == '+': print first + second elif operators[use] == '-': print first - second elif operators[use] == '/': print first / second elif operators[use] == '*': print first * second print 'Thanks for using'