Simple addition calculator in python

Posted by Krysten on Stack Overflow See other posts from Stack Overflow or by Krysten
Published on 2011-01-12T05:14:16Z Indexed on 2011/01/12 5:53 UTC
Read the original article Hit count: 210

Filed under:

I built a very simple addition calculator in python:

#This program will add two numbers entered in by the user

print "Welcome!"

num1 = input("Please enter in the first number to be added.")
num2 = input("Please enter in the second number to be added.")

sum = num1 + num2

print "The sum of the two numbers entered is: ", sum

I haven't setup python yet, so I'm using codepad.org (an online compiler). I get the following error: Welcome! Please enter in the first number to be addeded.Traceback (most recent call last): Line 5, in num1 = input("Please enter in the first number to be addeded.") EOFError

© Stack Overflow or respective owner

Related posts about python