[Tutor] error generating

Alan Gauld alan.gauld at yahoo.co.uk
Fri Feb 19 07:05:08 EST 2021


On 19/02/2021 02:50, prashant sahu wrote:

> while choice>4:
>     print(
>     """
...
>     """
>       )
>     choice= int(input("Choice: "))
>         if choice==4:
>         term= input("\nWhat term do you want me to delete___:")
>         if term in geek:
>             del geek[term]
>             print(term,"\nis no more in ur dictionary")
>         else:
>             print("chill buddy,,, this ",term," is already out of my
> dictionary")
> input()
> 
> when i am executing this code this is showing error massage like this:
> "syntex error
>    Unindent  does not match any outer indentation level"
> please help me here

That's because your indentation does not match up.

The if under choice... is indented but it shouldn't be and
the term= line is not indented but it should be.

Python is usually pretty accurate in its error messages.
The line is occasionally one or two out but if you look
a few lines above the reported line you will usually
see the error.

Speaking of which, when posting questions it's always
helpful if you post the entire error message not just
the last line, they contain a lot of useful information.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list