私信  •  关注

Wanmi Siangshai

Wanmi Siangshai 最近创建的主题
Wanmi Siangshai 最近回复了
6 年前
回复了 Wanmi Siangshai 创建的主题 » Python While循环不执行else块

if-else 是一个条件语句,因此取决于 if 它将执行任意一个语句。

程序中的一个示例:

Say you enter a number 30 when you run the program, it will print "slide under" but suppose 
if you enter 10 your program will print "jump over".

因此,根据您的输入,它将打印其中一个语句,但不会同时打印这两个语句。