Python 如何消除elif语法错误
我想做一个生活模拟器。 我一直收到一个关于这个部分的无效语法警告。 似乎没有缩进错误。 它过去是有用的。 只有这一部分不起作用 如果您想查看更多代码,请访问此网站:并向下滚动至版本4。我相信这一行 printMoney{}.formatMoney 会给你带来麻烦,因为正如吉尔奇在上面的评论中所说,你的括号太多了。将该行修改为 printMoney{}.formatMoneyPython 如何消除elif语法错误,python,python-3.x,Python,Python 3.x,我想做一个生活模拟器。 我一直收到一个关于这个部分的无效语法警告。 似乎没有缩进错误。 它过去是有用的。 只有这一部分不起作用 如果您想查看更多代码,请访问此网站:并向下滚动至版本4。我相信这一行 printMoney{}.formatMoney 会给你带来麻烦,因为正如吉尔奇在上面的评论中所说,你的括号太多了。将该行修改为 printMoney{}.formatMoney 看看这是否有效 检查括号 while Time5 == "true": Act5 = input("\nW
看看这是否有效 检查括号
while Time5 == "true":
Act5 = input("\nWhat would you like to do this year? You can: Play Videogames | Punch your parents | Browse the internet | Youtube | Steal Food |Check Stats | Check Assests: \n")
if Act5 == "Check Stats":
print("Your Stats")
print("Sanity:{}".format(Sanity))
print("Happiness:{}".format(Happiness))
print("Health{}".format(Health))
print("Money{}".format((Money))
elif Act5 == "Steal Food":
print("You went over to your local Wendys and stole a Happy Meal.")
Happiness = Happiness + 12
print("The addreniline RUSH gave you 12 extra happiness\n")
if Happiness > 100:
print("Your HAPPINESS is maxed.")
Wendy = input("You see another door to your left. It is the staff door. Will you enter? Yes or No \n")