目前我的代码非常简单
#BlackJack
print("welcome to Wasteful's blackjack game")`
print("this program was built using standard python")
print("please select a option")
print("A to start, B to quit")
print("----------------------------")
menu_select = input("A/B: ").lower
if menu_select == "a":
print("starting game when i can be assed to program it")
elif menu_select == "b":
exit()
else:
print("invalid")
但是a
和b
都返回空白?我被困住了,需要一些帮助,谢谢
编辑:我注意到了.lower中的愚蠢错误,应该是.lower()
首先,正如rassar所说,您必须在从用户获得输入后调用.lower()。 下一步,我总是发现创建一个主循环函数来调用所有未来的函数更容易,并且代码保持整洁!希望这有点帮助! 快乐编码!:)
这是因为您没有调用
lower()
,而是将menu_select
设置为函数本身:将您的线路改为:
相关问题 更多 >
编程相关推荐