Last active
July 14, 2023 22:24
-
-
Save CasperEngl/0ee5d2d86f5f50cf1c203eaa63ebb9ab to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # =================== | |
| # 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