,所以我一直在开发自己的文明游戏,我正在研究,以便您可以更改税款,但是我在elif
上遇到了有关您在更换税收方面的选择的错误这是代码:
moneytalk = int(input("your people doesn't like the new tax do you want to tell them why you have made it so high? 1 = yes, 2 = no"))
if moneytalk == 1:
talkingmoney = int(input("1 = we have been losing so much money that the goverment needs more, 2 = we have trades that we need to have money for, 3 = its under our avrage right now so we need to higher it"))
if talkingmoney == 1:
if my_stats_on_my_city["Gold"] <= 1000:
print ("your people belive in you and they are no angry with you")
else:
moneyrandom = randint(1, 10)
if moneyrandom >= 6:
print ("they belive you")
else:
print ("they know you are lying and are even more upset now")
My_people_info["Happines"] -= 5;
My_people_info["Happines"] -= int(higher);
elif talkingmoney == 2:
pass #i will add here after the trading system
elif talkingmoney == 3:
elif moneytalk == 2:
My_people_info["Happines"] -= 3;
My_people_info["Happines"] -= int(higher);
我会收到以下错误:
elif moneytalk == 2:
IndentationError: expected an indented block
elif talkingmoney == 2:
pass #i will add here after the trading system
elif talkingmoney == 3:
elif moneytalk == 2:
My_people_info["Happines"] -= 3;
My_people_info["Happines"] -= int(higher);
您在elif talkingmoney == 3:
分支下没有任何代码。至少需要有一个pass
语句。
moneytalk = int(input("your people doesn't like the new tax do you want to tell them why you have made it so high? 1 = yes, 2 = no"))
if moneytalk == 1:
talkingmoney = int(input("1 = we have been losing so much money that the goverment needs more, 2 = we have trades that we need to have money for, 3 = its under our avrage right now so we need to higher it"))
if talkingmoney == 1:
if my_stats_on_my_city["Gold"] <= 1000:
print ("your people belive in you and they are no angry with you")
else:
moneyrandom = randint(1, 10)
if moneyrandom >= 6:
print ("they belive you")
else:
print ("they know you are lying and are even more upset now")
My_people_info["Happines"] -= 5;
My_people_info["Happines"] -= int(higher);
elif talkingmoney == 2:
pass #i will add here after the trading system
elif talkingmoney == 3:
# You need to paas any statement over here
elif moneytalk == 2:
My_people_info["Happines"] -= 3;
My_people_info["Happines"] -= int(higher);
您需要在
下使用任何语句Elif TalkingMoney == 3: