Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 应为缩进块无法找到问题_Python_Python 3.x - Fatal编程技术网

Python 应为缩进块无法找到问题

Python 应为缩进块无法找到问题,python,python-3.x,Python,Python 3.x,所以我一直在做我自己的文明游戏,我正在做这样的工作,你可以改变税收,但我得到了一个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 =

所以我一直在做我自己的文明游戏,我正在做这样的工作,你可以改变税收,但我得到了一个
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 talkingmoney==3:
分支下没有任何代码。至少需要有一个
pass
声明。

moneytalk=int(输入(“您的人民不喜欢新税,您想告诉他们您为什么把它定得这么高吗?1=yes,2=no”))
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);
如果moneytalk==1: talkingmoney=int(输入(“1=我们损失了太多的钱,政府需要更多的钱,2=我们有需要花钱的交易,3=目前处于我们的控制之下,所以我们需要提高它”)) 如果talkingmoney==1: 如果my_在my_city[“Gold”]=6: 打印(“他们相信你”) 其他: 打印(“他们知道你在撒谎,现在更难过了”) 我的人民信息[“快乐”]-=5; My_people_info[“Happines”]-=整数(更高); elif talkingmoney==2: pass#我会在交易系统之后添加到这里 elif talkingmoney==3: #你需要在这里填写任何声明 elif moneytalk==2: 我的人民信息[“快乐”]-=3; My_people_info[“Happines”]-=整数(更高);
你需要在下面写任何声明

elif talkingmoney==3:


我在第2行得到一个缩进错误。这些是什么应该是什么意思?这是python的基本规则:保持缩进,使用一些好的编辑器IDE来避免这种情况mistake@MSeifert请看一下PM 2Ring在您针对被愚弄者的问题下的评论:“虽然这个问题及其答案看起来很好,但请不要将其作为复制闭合缩进错误问题的目标。这样的问题应该被关闭作为打印错误(或者可能是“缺少MCVE”),这样他们就可以通过自动清理过程从系统中删除。“我建议你重新打开这个问题,这样我们就可以投票把它关闭成一个打印错误。”我不认为大多数压痕问题是键入,所以我会继续对它们进行重合,我可以用它作为DUPE目标。“但是问题中的Indentationerror(追溯)似乎与<代码> ELIF MunyTalk=2:< /代码>部分(请注意<代码> 2 < /代码>而不是<代码> 3 < /代码>)。
    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);
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);