Skip to content

Instantly share code, notes, and snippets.

@CasperEngl
Last active July 14, 2023 22:24
Show Gist options
  • Save CasperEngl/0ee5d2d86f5f50cf1c203eaa63ebb9ab to your computer and use it in GitHub Desktop.
Save CasperEngl/0ee5d2d86f5f50cf1c203eaa63ebb9ab to your computer and use it in GitHub Desktop.
# ===================
# Variables
# ===================
count = 0 # assign 0 to count
print(count) # prints 0
count = 1 # assign 1 to count
print(count) # prints 1
count = 2 # assign 2 to count
print(count) # prints 2
# ===================
# Boolean checks
# ===================
count = 0
count == 1 # compare count to 1 == False
# count is still 0
count == 2 # compare count to 2 == False
# count is still 0
print(count) # prints 0
# ===================
# Variables with math
# ===================
count = 0
count = count + 1 # add 1 to count
print(count) # prints 1
count = count + 1 # add 1 to count
print(count) # prints 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment