[Tutor] Stuck on error

Joel Goldstick joel.goldstick at gmail.com
Fri Dec 20 19:33:23 CET 2013


On Fri, Dec 20, 2013 at 1:27 PM, Joel Goldstick <joel.goldstick at gmail.com>wrote:

>
>
>
> On Fri, Dec 20, 2013 at 11:36 AM, NZHacker1 . <nikolausmz at 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 at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20131220/8ce261b5/attachment.html>


More information about the Tutor mailing list