答案 0 :(得分:0)
您默认选中的元素没有值。那么你提交它就会得到$what_about
和$im equals ['']
的默认值。在以后的代码中,您需要$what_about[1]
或$im[1]
我建议您在致电count($what_about) == 2
之前检查$what_about[1]
是否count($im) == 2
以及$im[1]
之前 <option selected disabled hidden value='|'><?php echo $im[1]; ?></option>
或设置默认选择选项
的值print("ask about your stats")
userInput = input()
while userInput != "Pass":
if userInput == "Stats":
print(billyMays)
elif userInput == "Health":
print(health)
elif userInput == "Hunger":
print(hunger)
elif userInput == "Voice":
print(voice)
else:
pass
userInput = None
print("goodbye")