我正在创建一个基于文本的游戏并询问性别。但似乎我的其他声明不起作用。
def genderask ():
gender = input ("Are you a he or a she?")
try:
if gender == "he" or "she":
print("Hello, ", name)
else:
print("Your answer was not he or she.")
print
genderask ()
except ValueError:
print ("Your answer was not he or she.")
print
genderask
打印 genderask()
答案 0 :(得分:0)
如果性别=="他"或性别=="她":