On Fri, Dec 20, 2013 at 1:27 PM, Joel Goldstick <joel.goldst...@gmail.com>wrote:
> > > > On Fri, Dec 20, 2013 at 11:36 AM, NZHacker1 . <nikolau...@gmail.com>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. What is line 47? > > >> >> >> Here's the code. >> >> import random >> >> for i in range(1): >> RN1 = random.randint(1,75) >> >> What do you think these loops do? They don't do anything except run the ramdon.randint() stuff once. So why the loops? > for i in range(1): >> RN2 = random.randint(1,75) >> >> for i in range(1): >> RN3 = random.randint(1,75) >> >> for i in range(1): >> RN4 = random.randint(1,75) >> >> for i in range(1): >> RN5 = random.randint(1,75) >> >> for i in range(1): >> RMB = random.randint(1,15) >> >> x = raw_input('Money in pennys.') >> Plays = int(x) * 100 >> plays = int(x) * 100 >> z = 0 >> Game = ('Game') >> while Plays != 0: >> Plays = Plays - 1 >> z = z + 1 >> for i in range(1): >> N1 = random.randint(1,75) >> >> for i in range(1): >> N2 = random.randint(1,75) >> >> for i in range(1): >> N3 = random.randint(1,75) >> >> for i in range(1): >> N4 = random.randint(1,75) >> >> for i in range(1): >> N5 = random.randint(1,75) >> >> for i in range(1): >> MB = random.randint(1,15) >> >> Game + z = N1 + N2 + N3 + N4 + N5 + MB >> >> z = 0 >> while plays != 0: >> Plays = Plays - 1 >> z = z + 1 >> print(Game + str(z)) >> >> In the above block you have 'plays' and 'Plays'. I suspect that is a >> problem for you >> _______________________________________________ >> Tutor maillist - Tutor@python.org >> To unsubscribe or change subscription options: >> https://mail.python.org/mailman/listinfo/tutor >> >> > > > -- > Joel Goldstick > http://joelgoldstick.com > -- Joel Goldstick http://joelgoldstick.com
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor