Welcome, guest | Sign In | My Account | Store | Cart

Put any numbers in and the program will give you the answer.

Python, 16 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
print "Calculator"
Firstnumber = input("Enter your first number: ")
Firstoperator = raw_input("Enter you operator: ")
Secondnumber = input ("Enter your second number: ")
if Firstoperator == "+":
    Firstnumber + Secondnumber
    print Firstnumber + Secondnumber
if Firstoperator == "*":
    Firstnumber * Secondnumber
    print Firstnumber * Secondnumber
if Firstoperator == "/":
    Firstnumber / Secondnumber
    print Firstnumber / Secondnumber
if Firstoperator == "-":
    Firstnumber - Secondnumber
    print Firstnumber - Secondnumber
Created by superducktoxic on Wed, 10 Jul 2013 (MIT)
Python recipes (4591)
superducktoxic's recipes (5)

Required Modules

  • (none specified)

Other Information and Tasks