a = input("enter the first age ")
print(a)
b = input("enter the seond age ")
pint(b)
c = input("enter the third age ")
print(c)
if (a != b and a != c and b != c):
{
if (a>b and a>c):
print ("a is the largest")
if (b>a and b>c):
print ("b is the largest")
else:
print ("c is the largest")
}
else:
print ("please enter distinct digits")
编译器说第 9 行“语法无效”。请告诉我。
之前我写的是 if() 所以我给了空间 if () 我相信缩进是正确的。
括号不是你麻烦的根源,尽管它们是无关的。大括号是。您还需要正确缩进内部条件。
a = input("enter the first age ")
print(a)
b = input("enter the seond age ")
print(b)
c = input("enter the third age ")
print(c)
if a != b and a != c and b != c:
if a > b and a > c:
print("a is the largest")
if b > a and b > c:
print("b is the largest")
else:
print("c is the largest")
else:
print("please enter distinct digits")