-3

So I have been working on my own kind of civilisation game and i am working on so you can change the taxes but I get this error for an elif about your choices in the tax changing thing this is the code:

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);

And I get the following error:

elif moneytalk == 2:
IndentationError: expected an indented block
derloopkat
  • 6,232
  • 16
  • 38
  • 45
Daniel
  • 33
  • 1
  • 1
  • 2
  • 1
    I got an `IndentationError` at line 2. – Right leg Sep 13 '17 at 10:17
  • What are these `;` supposed to mean? – MSeifert Sep 13 '17 at 10:19
  • it's basic rule of python: maintain indentation, use some good editor IDE to avoid such mistake – Gahan Sep 13 '17 at 10:20
  • @MSeifert Please have a look at PM 2Ring's comment under the question you targeted as dupe: "While this question & its answer looks quite good, please do not use it a target to dupe-close indentation error questions. Such questions should be closed as typos (or possibly "lacking MCVE") so they can be removed from the system by the automatic cleanup process.". I suggest that you just reopen that question so that we can vote to close it as a typo. – Right leg Sep 13 '17 at 10:21
  • @Rightleg Consider the comment below that one with 4x the upvotes: "I don't consider most indentation problems to be typos, so I'll continue to dupe-close them, and I may use this as the dupe target." – John Kugelman Sep 13 '17 at 10:32

2 Answers2

0
    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);

You don't have any code under the elif talkingmoney == 3: branch. There needs to be a pass statement at a minimum.

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
  • But the Indentationerror in the question (traceback) seems to be related to the `elif moneytalk == 2:` part (note the `2` not the `3`). – MSeifert Sep 13 '17 at 10:36
0
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);

You need to paas any statement over here under

elif talkingmoney == 3:

shashank
  • 1,133
  • 2
  • 10
  • 24