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


Groups > comp.lang.python > #78730

Re: Practice question

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Practice question
Date 2014-10-05 19:47 -0400
References <h2j33adothf9uctcdp5psqk2cclr01961r@4ax.com>
Newsgroups comp.lang.python
Message-ID <mailman.14621.1412552876.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 10/5/2014 7:02 PM, Seymore4Head wrote:
> For the record, I don't want a hint.  I want the answer.
> I see a practice question is similar to this.
> 15 <= x < 30  And it wants a similar expression that is equivalent.
> So the right answer is 15<= x or x <30
> but one of the other answers is
> not (15<= x and x <30)
>
> But it says.....remember you can try this out in the Python shell.
> How?

For instance,
for x in (10, 20, 30, 40):
     print((15 <= x < 30) == (15<= x and x <30))



-- 
Terry Jan Reedy

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


Thread

Practice question Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-05 19:02 -0400
  Re: Practice question Roy Smith <roy@panix.com> - 2014-10-05 19:06 -0400
  Re: Practice question Ned Batchelder <ned@nedbatchelder.com> - 2014-10-05 19:14 -0400
    Re: Practice question Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-05 20:07 -0400
      Re: Practice question Ned Batchelder <ned@nedbatchelder.com> - 2014-10-05 21:25 -0400
      Re: Practice question Steven D'Aprano <steve@pearwood.info> - 2014-10-07 08:41 +0000
  Re: Practice question Skip Montanaro <skip.montanaro@gmail.com> - 2014-10-05 18:33 -0500
    Re: Practice question Rustom Mody <rustompmody@gmail.com> - 2014-10-05 19:47 -0700
      Re: Practice question Skip Montanaro <skip.montanaro@gmail.com> - 2014-10-06 08:04 -0500
        Re: Practice question Rustom Mody <rustompmody@gmail.com> - 2014-10-06 09:23 -0700
          Re: Practice question Chris Angelico <rosuav@gmail.com> - 2014-10-07 03:52 +1100
            Re: Practice question Rustom Mody <rustompmody@gmail.com> - 2014-10-06 10:05 -0700
              Re: Practice question Chris Angelico <rosuav@gmail.com> - 2014-10-07 04:13 +1100
              Re: Practice question Steven D'Aprano <steve@pearwood.info> - 2014-10-06 20:49 +0000
                Re: Practice question "Redge @ Versalytics.com" <versalytics@gmail.com> - 2014-10-06 20:54 -0400
                Re: Practice question Rustom Mody <rustompmody@gmail.com> - 2014-10-08 09:14 -0700
                Re: Practice question Chris Angelico <rosuav@gmail.com> - 2014-10-09 03:23 +1100
                Re: Practice question Skip Montanaro <skip.montanaro@gmail.com> - 2014-10-08 11:27 -0500
                Re: Practice question Rustom Mody <rustompmody@gmail.com> - 2014-10-08 09:41 -0700
  Re: Practice question Terry Reedy <tjreedy@udel.edu> - 2014-10-05 19:47 -0400
    Re: Practice question Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-05 20:18 -0400
      Re: Practice question Steven D'Aprano <steve@pearwood.info> - 2014-10-07 08:48 +0000
        Re: Practice question C Smith <illusiontechniques@gmail.com> - 2014-10-07 05:43 -0700
  Re: Practice question C Smith <illusiontechniques@gmail.com> - 2014-10-05 16:24 -0700
  Re: Practice question Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-07 01:46 +0000
    Re: Practice question Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-10-06 22:06 -0400
      Re: Practice question alister <alister.nospam.ware@ntlworld.com> - 2014-10-09 15:28 +0000

csiph-web