gpt4 book ai didi

Python - 和,或验证

转载 作者:太空宇宙 更新时间:2023-11-04 08:12:56 26 4
gpt4 key购买 nike

<分区>

从代码中可以明显看出,但我想检查输入是否不等于这些值而不是再次询问。我认为这行得通,但行不通,而且出现故障,有什么更好的方法来做到这一点?

type=input("Please choose an option: ")
while type.isalpha() == False:
type=input("Please choose an option: ")
while type != ("a" and "A" and "b" and "B" and "c" or "C"):
type=input("Please choose an option: ")

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com