On Sep 10, 2017 8:40 AM, "Senthil Kumaran" <sent...@uthcode.com> wrote:
>
> > unindent does not match any outer indention level
>
> Means that your Intendentaion is not proper. You should align your print
> statement and rest to the same level as if statement.
>
> Use a proper editor that supports Python Syntax.
>
Also the last line will print access granted if the password does not
match. Probably not what you wanted. Either indent it and put it before
break or unindent it so it lines up with while.

For what it's worth if the user never gets the password he is stuck forever
in the loop.

In the future please include the entire traceback in your email. That makes
it a lot easier for us to relate it to your code.

> On Sun, Sep 10, 2017 at 4:32 AM, Elmar Klein <geoke...@gmx.at> wrote:
>
> > Hi there,
> >
> > im starting to learn how to code (bougt me the "automate the boring
stuff
> > with phyton" book).
> >
> > And im not going anywhere with a code sample using the "continue"
> > statement.
> >
> > The code i should try is as following:
> >
> > while True:
> >       print ('who are you')
> >       name = input ()
> >       if name != 'bert':
> >               continue
> >         print ('hi, joe. pwd?')
> >         pwd = input ()
> >         if pwd == 'sword':
> >                 break
> >         print ('access granted')
> >
> > But everytime this produces an error (unindent does not match any outer
> > indention level) in the "print ('hi, joe. Pwd?')" sentence.
> >
> > What am i doing wrong?
> >
> > Greetings
> >
> > kerbi
> >
> >
> >
> > _______________________________________________
> > Tutor maillist  -  Tutor@python.org
> > To unsubscribe or change subscription options:
> > https://mail.python.org/mailman/listinfo/tutor
> >
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to