Python中ifelse语句出错
Python中用if……else语句编写代码,结果出现错误:
源码为:
number = 2if number == 2:
print("you are fool")
else:
print("you are beautiful")
错误提示为:
仔细看了一下,结果是else的缩进发生了错误。
修正后的代码为:
number = 2if number == 2:
print("you are fool")
else:
print("you are beautiful")
运行结果为:
以上是 Python中ifelse语句出错 的全部内容, 来源链接: utcz.com/z/529043.html