Re: [Tutor] Random list exercise

2010-09-10 Thread lists
>  On 9/10/2010 5:22 AM, lists wrote: >>> >>> you could try random.shuffle and save a lot of time, it takes a mutable >>> sequence (like a list) and shuffles it >> >> Hey there, >> >> For the few exercises I've been doing, I think the author has been >> attempting to make the reader do things 'the

Re: [Tutor] Random list exercise

2010-09-10 Thread Chris King
On 9/10/2010 5:22 AM, lists wrote: you could try random.shuffle and save a lot of time, it takes a mutable sequence (like a list) and shuffles it Hey there, For the few exercises I've been doing, I think the author has been attempting to make the reader do things 'the difficult way' so that th

Re: [Tutor] Random list exercise

2010-09-10 Thread Chris King
On 9/10/2010 5:22 AM, lists wrote: you could try random.shuffle and save a lot of time, it takes a mutable sequence (like a list) and shuffles it Hey there, For the few exercises I've been doing, I think the author has been attempting to make the reader do things 'the difficult way' so that th

[Tutor] Random list exercise

2010-09-10 Thread lists
Ooops, I forgot to send to the list too! -- Forwarded message -- From: lists Date: Fri, Sep 10, 2010 at 10:22 AM Subject: Re: [Tutor] Random list exercise To: Christopher King > you could try random.shuffle and save a lot of time, it takes a mutable > sequence (like

Re: [Tutor] Random list exercise

2010-09-09 Thread Christopher King
forgot to send it to the list On Thu, Sep 9, 2010 at 9:58 PM, Christopher King wrote: > you could try random.shuffle and save a lot of time, it takes a mutable > sequence (like a list) and shuffles it > > > On Thu, Sep 9, 2010 at 6:39 PM, lists wrote: > >> >>> Several small and not so small poin

Re: [Tutor] Random list exercise

2010-09-09 Thread lists
>>> Several small and not so small points: >>> >>> 1. you assign wordslen each pass through your loop.  While it doesn't >>> matter in a small loop, it wastes time on the order of the size of your >>> list.  Instead move wordslen = len(...  above your while loop.  Any time you >>> put code in a loo

Re: [Tutor] Random list exercise

2010-09-09 Thread lists
>>> >>> Hi tutors, >>> >>> Still on my Python learning journey! I've just competed an exercise >>> which asks the student to "Create a program that creates a list of >>> words in random order. This program should print all the words and not >>> repeat any." I've printed the list for my own needs. T

Re: [Tutor] Random list exercise

2010-09-09 Thread lists
> > > On Thu, Sep 9, 2010 at 4:51 PM, lists wrote: >> >> Hi tutors, >> >> Still on my Python learning journey! I've just competed an exercise >> which asks the student to "Create a program that creates a list of >> words in random order. This program should print all the words and not >> repeat an

Re: [Tutor] Random list exercise

2010-09-09 Thread Joel Goldstick
On Thu, Sep 9, 2010 at 5:42 PM, Joel Goldstick wrote: > > > On Thu, Sep 9, 2010 at 4:51 PM, lists wrote: > >> Hi tutors, >> >> Still on my Python learning journey! I've just competed an exercise >> which asks the student to "Create a program that creates a list of >> words in random order. This p

Re: [Tutor] Random list exercise

2010-09-09 Thread Joel Goldstick
On Thu, Sep 9, 2010 at 4:51 PM, lists wrote: > Hi tutors, > > Still on my Python learning journey! I've just competed an exercise > which asks the student to "Create a program that creates a list of > words in random order. This program should print all the words and not > repeat any." I've print

[Tutor] Random list exercise

2010-09-09 Thread lists
Hi tutors, Still on my Python learning journey! I've just competed an exercise which asks the student to "Create a program that creates a list of words in random order. This program should print all the words and not repeat any." I've printed the list for my own needs. The list randwords aims to a