Re: [Tutor] making a random list, then naming it

2013-05-25 Thread Oscar Benjamin
On 25 May 2013 02:51, eryksun wrote: > On Fri, May 24, 2013 at 9:10 PM, Dave Angel wrote: >> >> Is lists[(3,8)] really so much harder to type than >> list_3_8 ? > > Since a comma creates a tuple, in this context you can just use > lists[3,8] to save a couple more keystrokes. Or even lists(

Re: [Tutor] making a random list, then naming it

2013-05-24 Thread eryksun
On Fri, May 24, 2013 at 9:10 PM, Dave Angel wrote: > > Is lists[(3,8)] really so much harder to type than > list_3_8 ? Since a comma creates a tuple, in this context you can just use lists[3,8] to save a couple more keystrokes. >>> from random import Random >>> randint = Random(42)

Re: [Tutor] making a random list, then naming it

2013-05-24 Thread Dave Angel
On 05/24/2013 09:35 PM, Jim Mooney wrote: On 24 May 2013 18:10, Dave Angel wrote: Is lists[(3,8)] really so much harder to type than list_3_8 ? You have a point. I hate underlines - my finger always misses them. Keyboards were not designed for programming ;') Anyway, I just thought

Re: [Tutor] making a random list, then naming it

2013-05-24 Thread Jim Mooney
On 24 May 2013 18:10, Dave Angel wrote: > Is lists[(3,8)] really so much harder to type than > list_3_8 ? > You have a point. I hate underlines - my finger always misses them. Keyboards were not designed for programming ;') Anyway, I just thought I'd try exec, but it's giving me fits putt

Re: [Tutor] making a random list, then naming it

2013-05-24 Thread Dave Angel
On 05/24/2013 08:04 PM, Jim Mooney wrote: You forgot to give the author attribution on the following paragraph. I happen to recognize my own text, but that's not a nice thing to do. Notice above where it says "Jim Mooney wrote" ? The short answer is that Python is not designed to be able t

Re: [Tutor] making a random list, then naming it

2013-05-24 Thread Jim Mooney
> The short answer is that Python is not designed to be able to do such a > thing. You're advised instead to make a dictionary, where the key is the > name you generate I was probably unclear what I wanted to do. Basically, enter a string of number pairs of lengths and maxvals to create and prin

Re: [Tutor] making a random list, then naming it

2013-05-23 Thread Dave Angel
On 05/23/2013 10:39 PM, Jim Mooney wrote: I keep needing random lists of integers for trying things, so I wrote a small prog I'll import as randlist. The user enters the length and max val, but then I want the actual data name of the random list created, to be list_(length entered)_(max value e

[Tutor] making a random list, then naming it

2013-05-23 Thread Jim Mooney
I keep needing random lists of integers for trying things, so I wrote a small prog I'll import as randlist. The user enters the length and max val, but then I want the actual data name of the random list created, to be list_(length entered)_(max value entered) as an easy mnemonic. I got as far