All pastes #820900 Raw Edit

Someone

public python v1 · immutable
·published 2007-12-17 20:23 UTC
rendered paste body
#!/usr/bin/env pythonoperators = ['+', '-', '/', '*']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 * secondprint 'Thanks for using'