【发布时间】:2018-02-04 23:50:21
【问题描述】:
它给了我 eof 解析错误。我不知道如何修复该拆分功能。请帮忙。谢谢。
#Is It An Equilateral Triangle?
def equiTri():
print("Enter three measure of a triangle: ")
a, b, c = input().split()
a = float(a)
b = float(b)
c = float(c)
if a == b == c:
print("You have an Equilateral Triangle.")
elif a != b != c:
print("This is a Scalene Triangle not an Equilateral Triangle.")
else:
print("""I'm guessing this is an Isosceles Triangle so definitely
not
an Equilateral Triangle.""")
【问题讨论】:
-
无法重现您的错误。它可能来自代码中的其他地方。您给定的代码也没有正确缩进。
-
修正原始缩进后同样无法重现错误。
-
您输入的内容是什么导致出现此错误?
-
我的输入是 5, 5, 5。我也试试 5 5 5。
-
我现在知道错误了。我在 3 中完成了代码。我放入了谷歌驱动器。回家。当然,在 2 中打开它。谢谢大家。
标签: python input python-2.x eof