[Tutor] Function help
Scott W Dunning
swdunning at cox.net
Mon Feb 24 02:47:09 CET 2014
On Feb 23, 2014, at 5:31 AM, Dave Angel <davea at davea.name> wrote:
>
> Welcome to the tutor forum also, Scott. You'll find it works very
> similarly to python-list, and has many of the same people on it.
> I'm not sure how you tried to attach source, but please be aware
> that this is a text list - anything other than plain text will
> probably be invisible or inconvenient to someone. Just paste
> snippets inline when needed.
I actually forgot to paste the code before I sent the email.
>
> What you're looking for is a loop. for and while are the two
> keywords for looping. In this case, since you know how many
> times you want to go round, loop is appropriate. Build a
> collection or iterator of length 5, and loop over it. range is
> designed for the purpose:
>
> for index in range (5):
> dosomething
> moresomething (index)
Thank you for this help. I believe I understand. At least enough to do a simple loop for what I need. I’ll check back and paste my code after and maybe you can tell me if there is anything I could be doing better/easier.
Thanks again!!
Scott
More information about the Tutor
mailing list