You are on page 1of 1

Python 2.7.9 (v2.7.

9:648dcafa7e5f, Dec 10 2014, 10:10:46)


[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable.
Visit http://www.python.org/download/mac/tcltk/ for current information.
## Comments - This program is a calculator program
print "Welcome to the Calculator!!!"
# Get the number from the user
num1 = input ("Enter the first number: ")
num2 = input ("Enter the second number: ")
# calculate the sum
addition = num1 + num2
# calculate the difference
diff = num1 - num2
# calculate the multiplication
mul = num1 * num2
# calculate the division
div = num1 / num2
# print out the result
print "The addition of the numbers you entered is: ", addition
print "The difference of the numbers you entered is: ", diff
print "The multiplication of the numbers you entered is: ", mul
print "The division of the numbers you entered is: ", div
Welcome to the Calculator!!!
>>>

You might also like