Re: [Tutor] Stuck on Error

2013-12-22 Thread Steven D'Aprano
On Sun, Dec 22, 2013 at 04:39:24AM -0500, Keith Winston wrote: [...] > You could do this entire piece with a list comprehension in one line, but > I'm only mentioning it b/c I just learned them. My crude first effort would > look like this: > > RN = [] # create the array RN > [RN.append(random.r

[Tutor] Stuck on Error

2013-12-22 Thread Keith Winston
On Sun, Dec 22, 2013 at 3:55 AM, wrote: > import random > > for i in range(1): > RN1 = random.randint(1,75) > As noted before, these "for i in range(1)" statements are pointless: iteration over a range of 1 is no iteration at all. This is exactly equivalent to simply saying RN1 = random

Re: [Tutor] Stuck on error

2013-12-22 Thread Steven D'Aprano
Please help us to help you. When you have a bug you want help with, post the ENTIRE error message, starting from the line Traceback (most recent call last) all the way to the end. Do not re-type it, copy and paste it. > Game + z = N1 + N2 + N3 + N4 + N5 + MB This line doesn't make any

Re: [Tutor] Stuck on error

2013-12-22 Thread Felix Dietrich
"NZHacker1 ." writes: > import random > > for i in range(1): > RN1 = random.randint(1,75) There is no point of using a for loop if you only intent to do something once. But looking at the following lines, it actually seems like you want something to happen multiple times: > for i in range(1):

Re: [Tutor] Stuck on error

2013-12-22 Thread Alan Gauld
On 21/12/13 20:36, NZHacker1 . wrote: I'm trying to make a lottery in python and I keep getting this error. There's an error in your program: ***Cant assign to operator.(Mega Millions, line 47) Did you read the replies sent last time? Did you understand them? It seems unlikely since you haven'

Re: [Tutor] Stuck on error

2013-12-22 Thread Mark Lawrence
On 21/12/2013 20:36, NZHacker1 . wrote: I'm trying to make a lottery in python and I keep getting this error. There's an error in your program: ***Cant assign to operator.(Mega Millions, line 47) Do you expect a different answer if you pose the same question with the same code a second time?

Re: [Tutor] Stuck on error

2013-12-21 Thread Marc Tompkins
On Sat, Dec 21, 2013 at 12:36 PM, NZHacker1 . wrote: > I'm not finished with the program and I put Plays = int(x) * 100, > plays = int(x) * 100 > on purpose. > > I don't think you understood what people were trying to tell you. Python is case-sensitive; "plays" and "Plays" are NOT the same vari

[Tutor] Stuck on error

2013-12-21 Thread NZHacker1 .
I'm trying to make a lottery in python and I keep getting this error. There's an error in your program: ***Cant assign to operator.(Mega Millions, line 47) Here's the code. import random for i in range(1): RN1 = random.randint(1,75) for i in range(1): RN2 = random.randint(1,75) for

Re: [Tutor] Stuck on error

2013-12-20 Thread Joel Goldstick
On Fri, Dec 20, 2013 at 1:27 PM, Joel Goldstick wrote: > > > > On Fri, Dec 20, 2013 at 11:36 AM, NZHacker1 . wrote: > >> I'm trying to make a lottery in python and i keep getting this error. >> Cant assign to operator.(Mega Millions, line 47) >> > > That isn't your code, or that isn't your error m

Re: [Tutor] Stuck on error

2013-12-20 Thread Alan Gauld
On 20/12/13 16:36, NZHacker1 . wrote: I'm trying to make a lottery in python and i keep getting this error. Cant assign to operator.(Mega Millions, line 47) Please always send the full error message not just the last part. There is a lot of useful data missing here. Here's the code. import r

Re: [Tutor] Stuck on error

2013-12-20 Thread Joel Goldstick
On Fri, Dec 20, 2013 at 11:36 AM, NZHacker1 . wrote: > I'm trying to make a lottery in python and i keep getting this error. Cant > assign to operator.(Mega Millions, line 47) > That isn't your code, or that isn't your error message. Cut and paste your actual code and your actual traceback. Wh

[Tutor] Stuck on error

2013-12-20 Thread NZHacker1 .
I'm trying to make a lottery in python and i keep getting this error. Cant assign to operator.(Mega Millions, line 47) Here's the code. import random for i in range(1): RN1 = random.randint(1,75) for i in range(1): RN2 = random.randint(1,75) for i in range(1): RN3 = random.randint