Posted: 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?
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
Python:
score == score + 1
does is that it asks if score is equal to score + 1
I assume you are trying to increase the score by one.
To do this you want to use
Python:
score = score + 1
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.