[Tutor] tables and dictionaries
Julieta Rangel
julieta_rangel@hotmail.com
Sat, 05 May 2001 01:39:09 -0500
Thanks for your suggestion and your program. As you might remember, I'm new
at programming, and eventhough I have a good reference book, it is not easy
to do it all alone. Sometimes I can read a section from the book until I'm
blue in the face and still not understand it. The thing is that I'm a hands
on learner, so I learn by example, and eventhough the book has examples to
go along with the explanations, it is still difficult because sometimes the
examples are not relevant or meaningful to me or might not answer all of my
questions. Since I don't have anyone to show me in an example what the book
is trying to say, it is very difficult for me to learn it. With the example
you gave me I learned more than I would have learnt if I had spend an entire
day reading about nested loops. Thank you so very much.
Julieta
>From: Sheila King <sheila@thinkspot.net>
>To: tutor@python.org
>CC: "Julieta Rangel" <julieta_rangel@hotmail.com>
>Subject: Re: [Tutor] tables and dictionaries
>Date: Fri, 04 May 2001 23:05:51 -0700
>
>On Fri, 04 May 2001 22:48:35 -0700, Sheila King <sheila@thinkspot.net>
>wrote
>about Re: [Tutor] tables and dictionaries:
>
>:
>:I suggest a nested loop structure, like this...
>:
>:for firstElt in list:
>: for secondElt in list:
>: table[ (firstElt, secondElt) ] = None
>
>Here's a thought:
>
>To help you better see what is going on in a nested looping structure like
>the
>one above (where one loop is inside another), try this piece of code, and
>see
>what it does:
>
> >>> for firstNum in range(2,5):
>... for secondNum in range(11,16):
>... print firstNum, ' + ', secondNum, ' = ', firstNum + secondNum
>... print "inside loop ended"
>...
>
>--
>Sheila King
>http://www.thinkspot.net/sheila/
>http://www.k12groups.org/
>
>
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com