编写的一个python程序,为什么if语句后的冒号显示invalid syntax?部分程序如下。
defmain():print('Letstart!')whileTrue:try:#Getthevalueofsquarefeet.square_feet=float(...
def main():
print('Let start!')
while True:
try:
# Get the value of square feet.
square_feet = float(input('How many square feet do you want to paint? ')
if (square_feet <= 0):
print('The value should be larger than zero, please try again! ')
continue
except ValueError:
print('The value must be real number,please try again! ')
else:
break 展开
print('Let start!')
while True:
try:
# Get the value of square feet.
square_feet = float(input('How many square feet do you want to paint? ')
if (square_feet <= 0):
print('The value should be larger than zero, please try again! ')
continue
except ValueError:
print('The value must be real number,please try again! ')
else:
break 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询