Re: Practice question

2014-10-09 Thread alister
On Mon, 06 Oct 2014 22:06:09 -0400, Seymore4Head wrote: > On Tue, 7 Oct 2014 01:46:37 + (UTC), Denis McMahon > wrote: > >>On Sun, 05 Oct 2014 19:02:31 -0400, Seymore4Head wrote: >> >>> For the record, I don't want a hint. I want the answer. >>> I see a practice question is similar to this.

Re: Practice question

2014-10-08 Thread Rustom Mody
On Wednesday, October 8, 2014 9:58:11 PM UTC+5:30, Skip Montanaro wrote: > On Wed, Oct 8, 2014 at 11:14 AM, Rustom Mody wrote: > > So pushing beginners away from print can push them up the learning > > curve more quickly > Or more quickly discourage them. I still use print for all sorts of > thin

Re: Practice question

2014-10-08 Thread Skip Montanaro
On Wed, Oct 8, 2014 at 11:14 AM, Rustom Mody wrote: > So pushing beginners away from print can push them up the learning > curve more quickly Or more quickly discourage them. I still use print for all sorts of things. In my opinion, there is often no need for fancy loggers, str.format, or the wri

Re: Practice question

2014-10-08 Thread Chris Angelico
On Thu, Oct 9, 2014 at 3:14 AM, Rustom Mody wrote: > The issue is not only that print is bad but that the interpreter is > good for learning and trying out. > > Are these two really unconnected. Lets see... One can > > - use print without the interpreter > - use the interpreter without print > - u

Re: Practice question

2014-10-08 Thread Rustom Mody
On Tuesday, October 7, 2014 2:19:39 AM UTC+5:30, Steven D'Aprano wrote: > I have fewer issues with your conclusion and analogy than I do with the > basic premise that there is a connection between Seymore's problem here > and the use, or non-use, of print in the interactive interpreter. I don't

Re: Practice question

2014-10-07 Thread C Smith
Steven D'Aprano wrote: >>With two numbers, 15 and 30, all you really need is five test cases: My solution assumed integers also, but after I posted it, I thought: "What about floating points?" On Tue, Oct 7, 2014 at 1:48 AM, Steven D'Aprano wrote: > On Sun, 05 Oct 2014 20:18:13 -0400, Seymore4He

Re: Practice question

2014-10-07 Thread Steven D'Aprano
On Sun, 05 Oct 2014 20:18:13 -0400, Seymore4Head wrote: > I think I get it now. You are using a sample of answers. So you could > actually just run through them all. (I haven't tried this yet) > > for x in range(lo,hi) > print((15 <= x < 30) == (15<= x and x <30)) Yes, except using print

Re: Practice question

2014-10-07 Thread Steven D'Aprano
On Sun, 05 Oct 2014 20:07:50 -0400, Seymore4Head wrote: > Here is the exact question, I was trying to post something similar. I > failed. > > http://i.imgur.com/iUGh4xf.jpg Please don't post screen shots if you can avoid it. You almost certainly can copy and paste the text from the web page. A

Re: Practice question

2014-10-06 Thread Seymore4Head
On Tue, 7 Oct 2014 01:46:37 + (UTC), Denis McMahon wrote: >On Sun, 05 Oct 2014 19:02:31 -0400, 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 equivale

Re: Practice question

2014-10-06 Thread Denis McMahon
On Sun, 05 Oct 2014 19:02:31 -0400, 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. I think part of the problem here is that you don't understand th

Re: Practice question

2014-10-06 Thread Redge @ Versalytics.com
> On Oct 6, 2014, at 4:49 PM, Steven D'Aprano wrote: > >> On Mon, 06 Oct 2014 10:05:40 -0700, Rustom Mody wrote: >> >>> On Monday, October 6, 2014 10:22:27 PM UTC+5:30, Chris Angelico wrote: On Tue, Oct 7, 2014 at 3:23 AM, Rustom Mody wrote: Consider the sequence: 1. Drives on th

Re: Practice question

2014-10-06 Thread Steven D'Aprano
On Mon, 06 Oct 2014 10:05:40 -0700, Rustom Mody wrote: > On Monday, October 6, 2014 10:22:27 PM UTC+5:30, Chris Angelico wrote: >> On Tue, Oct 7, 2014 at 3:23 AM, Rustom Mody wrote: >> > Consider the sequence: >> > 1. Drives on the wrong side of the road 2. Has no clue that there's >> > such a con

Re: Practice question

2014-10-06 Thread Chris Angelico
On Tue, Oct 7, 2014 at 4:05 AM, Rustom Mody wrote: > On Monday, October 6, 2014 10:22:27 PM UTC+5:30, Chris Angelico wrote: >> On Tue, Oct 7, 2014 at 3:23 AM, Rustom Mody wrote: >> > Consider the sequence: >> > 1. Drives on the wrong side of the road >> > 2. Has no clue that there's such a concept

Re: Practice question

2014-10-06 Thread Rustom Mody
On Monday, October 6, 2014 10:22:27 PM UTC+5:30, Chris Angelico wrote: > On Tue, Oct 7, 2014 at 3:23 AM, Rustom Mody wrote: > > Consider the sequence: > > 1. Drives on the wrong side of the road > > 2. Has no clue that there's such a concept as 'wrong side of road' > > 3. Teaches people to drive wi

Re: Practice question

2014-10-06 Thread Chris Angelico
On Tue, Oct 7, 2014 at 3:23 AM, Rustom Mody wrote: > Consider the sequence: > > 1. Drives on the wrong side of the road > 2. Has no clue that there's such a concept as 'wrong side of road' > 3. Teaches people to drive without conveying anything about 'wrong side of > road' > > Hopefully you will

Re: Practice question

2014-10-06 Thread Rustom Mody
On Monday, October 6, 2014 6:34:27 PM UTC+5:30, Skip Montanaro wrote: > On Sun, Oct 5, 2014 at 9:47 PM, Rustom Mody wrote: > > Sorry Seymore if this sounds condescending -- its not a complaint > > against you but against those who treat the print statement/expression as > > kosher for newbies. >

Re: Practice question

2014-10-06 Thread Skip Montanaro
On Sun, Oct 5, 2014 at 9:47 PM, Rustom Mody wrote: > Sorry Seymore if this sounds condescending -- its not a complaint > against you but against those who treat the print statement/expression as > kosher for newbies. So if you're not griping about Seymore's original post, are you griping about my

Re: Practice question

2014-10-06 Thread C Smith
14 wrote: > On 10/5/14 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 > > > No, "15 <= x < 3

Re: Practice question

2014-10-05 Thread Rustom Mody
On Monday, October 6, 2014 5:04:11 AM UTC+5:30, Skip Montanaro wrote: > On Oct 5, 2014 6:07 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.

Re: Practice question

2014-10-05 Thread Ned Batchelder
On 10/5/14 8:07 PM, Seymore4Head wrote: On Sun, 05 Oct 2014 19:14:27 -0400, Ned Batchelder wrote: On 10/5/14 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

Re: Practice question

2014-10-05 Thread Seymore4Head
On Sun, 05 Oct 2014 19:47:40 -0400, Terry Reedy wrote: >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 ans

Re: Practice question

2014-10-05 Thread Seymore4Head
On Sun, 05 Oct 2014 19:14:27 -0400, Ned Batchelder wrote: >On 10/5/14 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 an

Re: Practice question

2014-10-05 Thread Terry Reedy
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 a

Re: Practice question

2014-10-05 Thread Skip Montanaro
On Oct 5, 2014 6:07 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. Maybe 30 > x >= 15 ? Seems more "similar" to the original expressi

Re: Practice question

2014-10-05 Thread Ned Batchelder
On 10/5/14 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 No, "15 <= x < 30" is equivalent to "15 <= x

Re: Practice question

2014-10-05 Thread Roy Smith
In article , Seymore4Head wrote: > For the record, I don't want a hint. I want the answer. 42. -- https://mail.python.org/mailman/listinfo/python-list