View Single Post
  #7 (permalink)  
Old 01-21-2008, 05:57 PM
nolls nolls is offline
Newbie
 
Join Date: Jan 2008
Posts: 18
Rep Power: 3
nolls is on a distinguished road
Default

Figured it out, thanks for the help!

Here is my calculator program if anyone wants to suggest anything to improve it (it doesn't boot up right away, I had to press enter after I executed it to run it, any reason for this?).

Code:
#!/C:Python25/Calc Test.py
print "Welcome to Nolls's Calculator 1.0"
option = 0
while option != 5:
    print "1. addition"
    print "2. subtraction"
    print "3. multiplication"
    print "4. division"
    print "5. exit"
    option = input("Which would you like to do? ")
    if option == 1:
        a = input("First number ")
        print a
        b = input("Plus second number ")
        print b
        print a + b
    elif option == 2:
        a = input("First number ")
        print a
        b = input("Minus second number ")
        print a - b
    elif option == 3:
        a = input("First number ")
        print a
        b = input("Multiplied by second number ")
        print b
        print a * b
    elif option == 4:
        a = input("First number ")
        print a
        b = input("Divided by second number ")
        print b
        print a / b
    elif option == 5:
        print "Goodbye!"
        exit ()
Reply With Quote