小编Jag*_*ght的帖子

Python while循环使用或不提供已消耗的输出

这是我的循环:

sure = input('Are you sure that you wish to reset the program?(y/n)')
while sure != 'y' or sure != 'n':
    sure = input('Please awnser y or n, Are you sure that you wish to reset the program?(y/n)')
Run Code Online (Sandbox Code Playgroud)

循环持续进行,即使循环y或者n被输入.

python logic while-loop

0
推荐指数
1
解决办法
59
查看次数

标签 统计

logic ×1

python ×1

while-loop ×1