Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #54453

Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it?

References <22b99b0a-598f-4500-9de9-5041c2ce2c8f@googlegroups.com> <CALwzidku1WQ0-+icfE+J8CjVNg4GEH4EF2Pf6cB8nCKyhDAfhQ@mail.gmail.com> <CAJsdK=JAY8gSxTyMVN+Ac2u_cwmY2PYwrTyQw1i43tPRJ+ymtw@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2013-09-19 17:09 -0600
Subject Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it?
Newsgroups comp.lang.python
Message-ID <mailman.168.1379632193.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Sep 19, 2013 at 1:22 PM, William Bryant <gogobebe2@gmail.com> wrote:
> It was the other functions above it. Thanks. but I tried to do the while
> loop - I don't think I did it right, I am novice in python and I am 13 years
> old.

It should be structured like this:

    while True:
        answer = input("Enter yes/no:")
        if answer in ('y', 'yes', 'new list'):
            do_yes_stuff()
            break
        elif answer in ('n', 'no', 'close'):
            do_no_stuff()
            break
        else:
            print("Please enter y or n.")

If they answer 'yes' or 'no', then the break statement breaks out of
the while loop.  Otherwise the while loop continues from the top and
asks them again.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? William Bryant <gogobebe2@gmail.com> - 2013-09-19 11:46 -0700
  Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? John Gordon <gordon@panix.com> - 2013-09-19 18:51 +0000
    Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? patrick vrijlandt <patrick.vrijlandt@gmail.com> - 2013-09-19 19:08 +0000
  Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Ian Kelly <ian.g.kelly@gmail.com> - 2013-09-19 13:01 -0600
  Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Dave Angel <davea@davea.name> - 2013-09-19 20:18 +0000
  Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Ian Kelly <ian.g.kelly@gmail.com> - 2013-09-19 17:09 -0600
    Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? William Bryant <gogobebe2@gmail.com> - 2013-09-20 00:01 -0700
      Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? William Ray Wing <wrw@mac.com> - 2013-09-20 09:04 -0400
      Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Duncan Booth <duncan.booth@invalid.invalid> - 2013-09-20 13:39 +0000
        Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? William Bryant <gogobebe2@gmail.com> - 2013-09-20 22:59 -0700
        Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? William Bryant <gogobebe2@gmail.com> - 2013-09-20 23:07 -0700
          Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-21 10:25 +0000
          Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Dave Angel <davea@davea.name> - 2013-09-21 12:53 +0000
          Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? MRAB <python@mrabarnett.plus.com> - 2013-09-21 17:18 +0100
          Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Dave Angel <davea@davea.name> - 2013-09-21 18:09 +0000
      Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? alex23 <wuwei23@gmail.com> - 2013-09-23 10:39 +1000

csiph-web