learning-python (23 Part Series)
The following are notes and details recapping a past live stream where we live code together. The idea behind these streams is that they provide real-world examples of running into problems and solving them or working towards solving them live.
✔ Warm up/Catch up with chat
✔ !mark/!note reminder and clips
✔ Learn about Python control statements: "if" "else" "elif"
✔ Closing and raid @rhymu8354
- We learned what "if" "else" and "elif" are and how they're used
- We created a small program to do coin flips
- How to write "if" statements
- How to use "else"
- How to use "elif"
- Third party package called colorama which adds color to the console/terminal: pypi.org/project/colorama
- VS Code provides helpers in our code for packages we installed and are using
- What not to do when comparing things in "if" statements
- Learn about "while" loops and how to control the flow of them
- Our Code Repository
- Nina Zakharenko's course we're following: Learn Python
- Python Cheat Sheet
- Microsoft Developer's Python for Beginners
Clips are a feature on Twitch that let you cut and capture segments of the live stream in the moment (up to 60 seconds). See how to use clips on Twitch for more details. The following are some fun moments captured from this stream:
- Code statements vs. expressions
- Demonstration of code statements vs. expressions
- Multi-line string in Python
- Python code documentation with strings in functions
- Randomness in Python
- Fixing two bugs in our coin flip program
- Reviewing our refactored code
- Recap of Learning Python from Scratch 010 - Control Statements: "if" "else" "elif"
Links not working on Twitch? It's most likely because Twitch will only save my stream recordings for about 60 days. Use the YouTube link at the top of this page instead.
This table helps point out different segments of the stream (highlighted in bold) or moments we learned something (not bold). The timestamps link to the video on Twitch at that point in the recording. If you'd like the YouTube link above will have similar timestamps and link to those same points in the recording as well.
|00:03:51||Kick it off|
|00:13:22||Instructions on how to contribute notes and marks (created by @roberttables)|
|00:16:05||Start learning about control statements if else and elif in Python|
|00:25:02||Definition of an expression (created by @LatJorr)|
|00:37:00||Importance of indentation in python (created by @LatJorr)|
|00:38:30||Trying out "if" statements in VS Code|
|00:51:37||Looking into an audio issue|
|00:52:10||Audio issue resolved|
|00:54:12||Question from @dioor on the difference between ' and " for strings|
|01:06:12||Creating a coin flip program|
|01:25:31||Digging into an issue in our code|
|01:28:43||Winner is if heads > tails (created by @LatJorr)|
|01:34:44||From @elkinforest20: upload code so that it is available to others|
|01:43:44||Back from break|
|01:45:48||Third party package called colorama which adds color to the console/terminal: pypi.org/project/colorama|
|01:48:55||VS Code provides helpers in our code for packages we installed and are using|
|01:54:08||Discussing random and pseudo-random|
|02:03:11||Using a function to determine the coin flip winner|
|02:14:39||Explanation of "elif" (created by @LatJorr)|
|02:32:03||Answer pgnus question about scopes in Python|
|02:41:02||What not to do when comparing things in "if" statements|
|02:43:45||PR to fix the "vice-versa" code here in section 6 of if else elif|
|02:49:44||Recap and raid|
Thanks for reading this article. If you're interested in finding more content from Microsoft Cloud Advocates check out this monthly curated newsletter: Developer Community Newsletter