Python Forum

Full Version: Unindent does not match any outer intendation level -error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I just started with learning Python. I got stuck on an error message which i can't get rid of: Unindent does not match any outer intendation level. What am i doing wrong?
All input is much appreciated!

print("1. Eieren")
print("2. Pannekoeken")
print("3. Wafels")
print("4. Havermout")
MainChoice=int(input("Kies een ontbijtgerecht: "))

if (MainChoice==2):
    Meal="Pannenkoeken"
elif (MainChoice==3):
    Meal="Wafels"
    
if (MainChoice==1):
    print("1. Volkoren")
    print("2. Zuurdesem")
    print("3. Toast")
    print("4. wit")
    Bread=int(input("Kies een broodsoort: "))

    
   if (Bread == 1):
       print("Je koos eieren met volkorenbrood.")
   elif(Bread==2):
        print("Je koos eieren met Zuurdesum")
   elif(Bread==3:
         print("Je koos eieren met toast")
   elif(Bread==4):
        print("Je koos eieren met witbrood")
   else:
        print("We hebben eieren maar niet die broodsoort.")

elif(MainChoice==2) or (MainChoice==3):
    print("1.Stroop")
    print("2.Aardbeien")
    print("3.poedersuiker")
    Topping=int("Kies een type beleg: "))

    if (Topping==1):
        print("Je koso "+ Meal + " met siroop.")
    elif (Topping==2):
        print("Je koso "+ Meal + " met aardbeien.")
    elif (Topping==3):
        print("Je koso "+ Meal + " met poedersuiker.")
    else:
        print("Je koso "+ Meal + " maar niet dat beleg.")

elif(MainChoice==4):
    print("Je koos havermout.")

else:
    print("Dat ontbijtgerecht hebben we niet!")
Please show the full traceback error message
Error:
File "c:/Users/Dave/Documents/VS Code WorkSpaces/pythonforum/general/forumpost.py", line 20 if (Bread == 1): ^ IndentationError: unindent does not match any outer indentation level
The if/elif/else are indented 3 spaces instead of 4

when that's fixed you have
Error:
File "c:/Users/Dave/Documents/VS Code WorkSpaces/pythonforum/general/forumpost.py", line 24 elif(Bread==3: ^ SyntaxError: invalid syntax
An open bracket with no close bracket but you don't need these brackets around all your conditions anyway

Then there is
Error:
File "c:/Users/Dave/Documents/VS Code WorkSpaces/pythonforum/general/forumpost.py", line 35 Topping=int("Kies een type beleg: ")) ^ SyntaxError: invalid syntax
One to many close brackets at the end
Line 20 is one space left (unindented) from the code before. Add a space to 20,22,24,26,28
Thank you very much, it worked!