Computer Science Canada Can't get dice roller to work? |
Author: | solarsparten [ Tue May 21, 2013 11:48 am ] |
Post subject: | Can't get dice roller to work? |
For some reason, this keeps out putting a score of zero after calculating 1000 rolls. It is supposed to add one to the score every time it goes through the loop. A little bit of help please? http://www.mediafire.com/view/323vp9f37z5ll1w/twoTwelve3.py |
Author: | ishidon [ Tue May 21, 2013 12:16 pm ] | ||||||||
Post subject: | Re: Can't get dice roller to work? | ||||||||
Everything in your code is correct except for one line.
So basically in this code block below,
you are rolling the dice 1000 times and if the two dice roll a sum of 2 or 12 you want to increase the score by 1. However, what
I assume you are trying to increase the score by one. To do this you want to use
Basically, when you use two equals signs you are trying to compare two things (returns True of False) but when you use one equals sign you are assigning a value. |