On May 1, 2014, at 5:30 AM, Steven D'Aprano st...@pearwood.info 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)]
On Mar 31, 2014, at 5:15 AM, Dave Angel da...@davea.name 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
On Mar 30, 2014, at 4:29 AM, Dave Angel da...@davea.name 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
On Mar 31, 2014, at 2:01 AM, Alan Gauld alan.ga...@btinternet.com 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,
On Mar 31, 2014, at 1:39 AM, Mark Lawrence breamore...@yahoo.co.uk 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
On Mar 28, 2014, at 10:36 PM, Ben Finney ben+pyt...@benfinney.id.au 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`
On Mar 29, 2014, at 12:47 AM, Dave Angel da...@davea.name 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.
On Mar 29, 2014, at 12:47 AM, Dave Angel da...@davea.name 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
On Mar 11, 2014, at 1:57 AM, Alan Gauld alan.ga...@btinternet.com 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
On Mar 10, 2014, at 11:18 PM, Dave Angel da...@davea.name 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
On Mar 8, 2014, at 6:36 AM, Dave Angel da...@davea.name wrote:
Mark Lawrence breamore...@yahoo.co.uk 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
On Mar 8, 2014, at 6:26 AM, Mark Lawrence breamore...@yahoo.co.uk wrote:
On 08/03/2014 01:23, Scott W Dunning wrote:
On Mar 7, 2014, at 11:02 AM, Alan Gauld alan.ga...@btinternet.com wrote:
GOT IT!! Finally! Thanks for all of your help!!
If at first you don't succeed... :)
On Mar 8, 2014, at 3:57 AM, spir denis.s...@gmail.com 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 alan.ga...@btinternet.com wrote:
GOT IT!! Finally! Thanks for all of your help!!
This is what I
13 matches
Mail list logo