Last active
October 10, 2016 20:52
-
-
Save MrDMurray/376dd212ec7838f73427eaed54d6111a to your computer and use it in GitHub Desktop.
STJLOL-DMU Score or Counter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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