Re: [Tutor] Help with Guess the number script

2014-03-08 Thread Scott W Dunning
On Mar 7, 2014, at 11:02 AM, Alan Gauld wrote: GOT IT!! Finally! Thanks for all of your help!! This is what I got, not sure if it’s correct but it’s working! def print_hints(secret, guess): if guess < 1 or guess > 100: print print "Out of range!" print if gues

Re: [Tutor] Help with Guess the number script

2014-03-10 Thread Scott W Dunning
On Mar 8, 2014, at 7:29 AM, eryksun wrote: > i.e. > >guess < 1 or guess > 100 > > becomes > >not not (guess < 1 or guess > 100) Why a not not? Wouldn’t that just be saying do this because the second not is undoing the first? > > distribute over the disjunction > >not (not (gue

Re: [Tutor] Help with Guess the number script

2014-03-10 Thread Scott W Dunning
On Mar 8, 2014, at 7:35 AM, Mark Lawrence wrote: > > I have no interest in the efficiency, only what is easiest for me to read, > which in this case is the chained comparison. As a rule of thumb I'd also > prefer it to be logically correct :) > What exactly is ment by a chained comparison?

Re: [Tutor] Help with Guess the number script

2014-03-10 Thread Scott W Dunning
On Mar 10, 2014, at 4:15 AM, eryksun wrote: > > Different strokes for different folks. I like to tinker with and > disassemble things as I'm learning about them. I would have been > ecstatic about open source as a kid. I learn simultaneously from the > top down and bottom up -- outside to inside

Re: [Tutor] Help with Guess the number script

2014-03-10 Thread Scott W Dunning
>> On Mar 8, 2014, at 3:57 AM, spir wrote: >>> >>> Well done. >>> And now that you have the right set of tests you can >>> half the number of lines by combining your if >>> conditions again, like you had in the original >>> post. ie. Bring your hot/cold/warm tests together. So below is what I fi

Re: [Tutor] Python implementations (was: Help with Guess the number script)

2014-03-10 Thread Scott W Dunning
On Mar 10, 2014, at 8:52 PM, Ben Finney wrote: > > What does the Python interactive prompt display when you first launch an > interactive Python shell? Python 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "copyright", "credits" or

Re: [Tutor] Python implementations (was: Help with Guess the number script)

2014-03-10 Thread Scott W Dunning
On Mar 10, 2014, at 8:52 PM, Ben Finney wrote: > > What does the Python interactive prompt display when you first launch an > interactive Python shell? Python 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "copyright", "credits" or

Re: [Tutor] Help with Guess the number script

2014-03-10 Thread Scott W Dunning
On Mar 8, 2014, at 11:50 AM, Scott dunning wrote: >>> >>> And now that you have the right set of tests you can >>> half the number of lines by combining your if >>> conditions again, like you had in the original >>> post. ie. Bring your hot/cold/warm

Re: [Tutor] Help with Guess the number script

2014-03-11 Thread Scott W Dunning
On Mar 10, 2014, at 11:18 PM, Dave Angel wrote: > Scott W Dunning Wrote in message: >> > > Would you please stop posting in html? I don’t know what you mean? I just use the text for my email provider. It’s not html? I types up the code I ha

Re: [Tutor] Help with Guess the number script

2014-03-11 Thread Scott W Dunning
On Mar 10, 2014, at 11:18 PM, Dave Angel wrote: Where are you guys using the forum? Through google? I was using that at first but someone complained about something that google does and told me to get it through my email. That’s what I’m doing now and I get bombarded with about 500 emails

Re: [Tutor] Help with Guess the number script

2014-03-11 Thread Scott W Dunning
On Mar 11, 2014, at 1:49 AM, Alan Gauld wrote: > > Not from the tutor list though. It only has a few > mails normally - less than 50 most days. > Actually now that you say that most of the emails are coming through the reg python-lists, not the tutor section. I guess I should just unsubscribe

Re: [Tutor] Help with Guess the number script

2014-03-11 Thread Scott W Dunning
On Mar 11, 2014, at 7:50 PM, William Ray Wing wrote: > > Simple. In Mail Preferences -> Composing -> Message Format -> Plain Text > (Your setting is probably currently Rich Text.) > Got it, hopefully that helps. ___ Tutor maillist - Tutor@python

[Tutor] Project suggestions

2014-03-12 Thread Scott W Dunning
!!! Scott ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] while loop

2014-03-28 Thread Scott W Dunning
On Mar 28, 2014, at 9:54 PM, Scott W Dunning wrote: > Hello, I’m working on some practice exercises from my homework and I’m having > some issues figuring out what is wanted. > > We’re working with the while loop and this is what the question states; > > Write a fun

[Tutor] while loop

2014-03-28 Thread Scott W Dunning
t the string `s`, `n` times. This is also in the exercises and I’m not sure what it means and why it’s there. assert isinstance(s, str) assert isinstance(n, int) Any help is greatly appreciated! Scott ___ Tutor maillist - Tutor@python.org To

[Tutor] exercise (while loop)

2014-03-31 Thread Scott W Dunning
I’m working on a few exercises and I’m a little stuck on this one. This is what the book has but it just gives me an endless loop. def square_root(a, eps=1e-6): while True: print x y = (x + a/x) / 2 if abs(y-x) < epsilon:

Re: [Tutor] exercise (while loop)

2014-03-31 Thread Scott W Dunning
On Mar 31, 2014, at 7:10 PM, Danny Yoo wrote: Thanks for the info Danny! I’ll try that and I should be able to figure it out with your help! The book I was referring to is greentreepress. ___ Tutor maillist - Tutor@python.org To unsubscribe or c

[Tutor] Final review

2014-05-01 Thread Scott W Dunning
l for now while compile my other questions you guys can hopefully help to shed light on. Thanks for any help!! Scott ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Final review

2014-05-05 Thread Scott W Dunning
On May 1, 2014, at 5:30 AM, Steven D'Aprano wrote: Awesome, thanks everyone! I understand lists a lot better now. I have another question. I don’t understand why below would give an error? >>> greeting = 'Hello World’ >>> greeting [len(greeting)] _

Re: [Tutor] Final review

2014-05-07 Thread Scott W Dunning
On May 5, 2014, at 10:13 PM, meenu ravi wrote: > Likewise, the index of d, which is the last word in the word "Hello world" is > 10. > > So, the maximum index you can access in the word "Hello world" is 10. But > when you try to give the command, > > >>> greeting [len(greeting)] > > It is t

Re: [Tutor] Installing twisted

2014-11-27 Thread Scott W Dunning
Hey guys I was hoping someone could tell me how to opted out of this list? I have it going to two email addresses for some reason and I unsubscribed but nothing happened. Any help is greatly appreciated! Thanks, Scott ___ Tutor maillist

[Tutor] counter not working in Quick Sort script

2015-10-29 Thread Patti Scott via Tutor
Mac OS 10.10 Python 3.4.3 I self-study Python and am using it for a Coursera algorithm class. Hi! My script sorts correctly on all my test arrays. My accumulator variable to count the number of comparisons returns nonsense. I'm counting the (length - one) of each sublist that will be sorted in

Re: [Tutor] counter not working in Quick Sort script

2015-10-30 Thread Patti Scott via Tutor
not working in Quick Sort script To: tutor@python.org Date: Thursday, October 29, 2015, 9:12 PM On 29/10/15 19:11, Patti Scott via Tutor wrote: Caveat: I didn't check the algorithms for correctness, I'll just take your word for that. > My accumulator variable to cou

Re: [Tutor] Depth First Search Listing all possible combinations

2013-11-24 Thread Randolph Scott-McLaughlin II
newpath = find_path(graph, node, end, path) if newpath: return newpath return None def find_all_paths(graph, start, end, path=[]): path = path + [start] if start == end: return [path] if not graph.has_key(start): return []

Re: [Tutor] Depth First Search Listing all possible combinations

2013-11-25 Thread Randolph Scott-McLaughlin II
I solved the question thanks to Alan's suggestions. Attached is the .py file I ran to solve my question. Thanks guys. On Sat, Nov 23, 2013 at 8:41 PM, Randolph Scott-McLaughlin II < randolph.michael...@gmail.com> wrote: > So I cleaned up the code to make it readable. I'm n

<    1   2   3