当键入NO或N时,文件一直保持运行状态,为什么?
<asp:CheckBoxList ID="tolgraph" runat="server" RepeatLayout="Table" CssClass="cb" RepeatDirection="Horizontal">
<asp:ListItem Text="Column" Value="column"></asp:ListItem>
<asp:ListItem Text="Line" Value="line"></asp:ListItem>
<asp:ListItem Text="Bar" Value="bar"></asp:ListItem>
<asp:ListItem Text="Pie" Value="pie"></asp:ListItem>
<asp:ListItem Text="Radar" Value="Radar"></asp:ListItem>
<asp:ListItem Text="Pareto" Value="Pareto"></asp:ListItem>
</asp:CheckBoxList>
tolgraph.Items.FindByText("Column").Selected = true;
答案 0 :(得分:1)
您的或陈述不正确的or y
将始终为真,请尝试以下操作:
import sys
while True:
game_choice = str(input('Do you want to play? ')).lower()
if game_choice == 'yes' or game_choice == 'y':
print("yes")
break
elif game_choice == 'no' or game_choice == 'n':
sys.exit()
else:
print('Please answer only Yes/y or No/n')
continue
或更好的版本:
import sys
while True:
game_choice = str(input('Do you want to play? ')).lower()
if game_choice in ['yes', 'y']:
print("yes")
break
elif game_choice in ['no', 'n']:
sys.exit()
else:
print('Please answer only Yes/y or No/n')
continue