Skip to content

Instantly share code, notes, and snippets.

@MrDMurray
Last active October 10, 2016 20:52
Show Gist options
  • Save MrDMurray/376dd212ec7838f73427eaed54d6111a to your computer and use it in GitHub Desktop.
Save MrDMurray/376dd212ec7838f73427eaed54d6111a to your computer and use it in GitHub Desktop.
STJLOL-DMU Score or Counter
score = 0 #set the starting score to 0
print (score) #prints the score
score = score + 1 #adds 1 to the score
print(score) #prints the score
score = score + 1 #adds 1 to the score
print(score) #prints the score
score = score + 3 #adds 3 to the score
print(score) #prints the score
print ("The final score is "+ str(score))
#the str() makes score (which is 5) a string (a word or letter) so it can be joined to the other
#words and letters before it. Remember computers can't add words to numbers without blowing up.
"""
Output looks like:
0
1
2
5
The final score is 5
"""
#Another way of doing "score = score +1" is to do "score +=1". Both of thise do the same thing, they add 1 to the score.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment