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] 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 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 Alan Gauld
On 30/03/14 02:36, Scott Dunning wrote: Your while loop doesn't quit after 10 times, it keeps going. Can you figure out why? This works without a break. > Is this more a long the line of what the excercise was > looking for you think? Yes. while n <= 10: print s n =

Re: [Tutor] while loop

2014-03-30 Thread Dave Angel
Scott Dunning Wrote in message: > > 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,