#!/usr/bin/env python # Magic Calculator # by Eric O'Callaghan (eric@ericoc.com) # The most pathetic piece of code you'll ever see. # Say hi print "\nWelcome to the mAgiC cAlCulAtoR!" print "This calculator is special because you have to enter a special number for the operation." print "1 - addition, 2 - subtraction, 3 - multiplcation, 4 - division" # Ask for first number first = input("\nEnter first number\n") # Ask for operation op = input("\nEnter the operation\n") # Ask for second number second = input("\nEnter second number\n") # Get result depending on operation if op == 1: result = first + second elif op == 2: result = first - second elif op == 3: result = first * second elif op == 4: result = first / second # Tell the result print "\nThe answer is:" print result