Re: [Tutor] Final review

2014-05-06 Thread Scott 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] while loop

2014-04-01 Thread Scott Dunning
On Mar 31, 2014, at 5:15 AM, Dave Angel wrote: > > Do you know how to define and initialize a second local variable? > Create one called i, with a value zero. > > You test expression will not have a literal, but compare the two > locals. And the statement that increments will change i, not

Re: [Tutor] while loop

2014-03-31 Thread Scott Dunning
On Mar 31, 2014, at 1:39 AM, Mark Lawrence wrote: > > They say that the truth hurts, so if that's the best you can come up with, I > suggest you give up programming :( You’re in the TUTOR section. People in here are new to programming. I’ve only been doing this for a couple months and I just

Re: [Tutor] while loop

2014-03-31 Thread Scott Dunning
On Mar 31, 2014, at 2:01 AM, Alan Gauld wrote: > > Incidentally, your assignment does not appear to require > a while loop, just iteration? If thats the case you could > use a for loop instead and it would actually be more > suitable. Have you covered for loops yet? > No, we haven’t got to fo

Re: [Tutor] while loop

2014-03-31 Thread Scott Dunning
On Mar 30, 2014, at 4:29 AM, Dave Angel wrote: > > You're getting closer. Remember that the assignment shows your > function being called with 10, not zero. So you should have a > separate local variable, probably called I, which starts at > zero, and gets incremented each time. > > The te

Re: [Tutor] while loop

2014-03-31 Thread Scott Dunning
On Mar 30, 2014, at 4:29 AM, Dave Angel wrote: > > > You're getting closer. Remember that the assignment shows your > function being called with 10, not zero. So you should have a > separate local variable, probably called I, which starts at > zero, and gets incremented each time. The exer

Re: [Tutor] while loop

2014-03-30 Thread Scott Dunning
On Mar 29, 2014, at 12:47 AM, Dave Angel wrote: > > So did your code print the string 10 times? When asking for help, > it's useful to show what you tried, and what was expected, and > what actually resulted. > > You use * to replicate the string, but that wasn't what the > assignment aske

Re: [Tutor] while loop

2014-03-30 Thread Scott Dunning
On Mar 29, 2014, at 12:47 AM, Dave Angel wrote: > > What are you uncertain about, assert or isinstance? Such > statements are frequently used to make sure the function > arguments are of the right type. I’m not sure exactly what it’s doing. I guess I need to read up on it again. > >> >> >

Re: [Tutor] while loop

2014-03-30 Thread Scott Dunning
On Mar 28, 2014, at 10:36 PM, Ben Finney wrote: > > A good programming exercise will show an example input and the expected > output, to give an unambiguous test case. Does the homework have that? This is what the exercise has as examples… """Print the string `s`, `n` times. Parameter

Re: [Tutor] Help with Guess the number script

2014-03-12 Thread Scott Dunning
On Mar 10, 2014, at 11:18 PM, Dave Angel wrote: > if guess < secret - 10 or guess > secret - 10: > > Think about that line. You might even want to put in a separate > function to test what it does. > HINT: it's wrong. > Got it! I realized what I was doing wrong. I needed that plus sign f

Re: [Tutor] Help with Guess the number script

2014-03-12 Thread Scott Dunning
On Mar 11, 2014, at 1:57 AM, Alan Gauld wrote: > OK so far, you don't need all the print statements > but that's just a style issue. (You could just > insert '\n' characters instead.) You’re right, I’m actually not sure why I did it that way. > >> if guess < secret - 10 or guess > secret -

Re: [Tutor] Help with Guess the number script

2014-03-08 Thread Scott dunning
> On Mar 8, 2014, at 3:57 AM, spir wrote: > >> On 03/08/2014 10:13 AM, Alan Gauld wrote: >>> On 08/03/14 01:23, Scott W Dunning wrote: >>> >>> 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

Re: [Tutor] Help with Guess the number script

2014-03-08 Thread Scott dunning
> On Mar 8, 2014, at 6:26 AM, Mark Lawrence wrote: > >> On 08/03/2014 01:23, Scott W Dunning wrote: >> >> On Mar 7, 2014, at 11:02 AM, Alan Gauld wrote: >> >> GOT IT!! Finally! Thanks for all of your help!! > > If at first you don't succeed... :) > >> >> This is what I got, not sure if i

Re: [Tutor] Help with Guess the number script

2014-03-08 Thread Scott dunning
> On Mar 8, 2014, at 6:36 AM, Dave Angel wrote: > > Mark Lawrence Wrote in message: >>> On 08/03/2014 01:23, Scott W Dunning wrote: >>> >>> >>> def print_hints(secret, guess): >>> if guess < 1 or guess > 100: >> >> Only now do I feel that it's time to point out that the above line would

[Tutor] Help with "Guess the Number" script

2014-02-28 Thread Scott Dunning
Hello, i am working on a project for learning python and I’m stuck. The directions are confusing me. Please keep in mind I’m very new to this. The directions are long so I’ll just add the paragraphs I’m confused about and my code if someone could help me out I’d greatly appreciate it! Also,