python中的简单加法计算器

python中的简单加法计算器,python,Python,我用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 pri

我用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
我还没有设置python,所以我使用codepad.org(一个在线编译器)。 我得到以下错误: 欢迎 请输入要添加的第一个号码。回溯(最近一次呼叫最后一次): 第5行,在 num1=输入(“请输入要添加的第一个数字。”)
EOFError

问题在于,虽然codepad会为您运行代码,但它不会给您任何交互性(程序在提示输入时失败,codepad不能给它任何输入,因此它会出错)。有关错误的更详细解释,请参阅

您确实需要继续安装Python,并在本地机器上使用它


哦,祝你学习Python好运

在有特殊输入框的地方使用。是的,仍然没有交互性,但是很方便。您只需在那里键入您的号码。

哦,好的。我在编译代码时下载了python,现在已经完成了,我要继续安装它。谢谢