Level 2: Online Articles - IncrediCoders/Python1 GitHub Wiki

Mrs. Scratcher added this page on March 14, 2025
Here are some more helpful articles about variables, key events, and if statements! You can skip down to these sections on this page:
-
Python init() Method - W3Schools - This is a W3schools page on Python init() methods.
-
init in Python - Geeks for Geeks - This is a GeeksforGeeks page on the init function and its role in Python initialization.
-
Class Initialization in Python - Jayant Nehra - This article gives a brief introduction to class initialization in Python and how constructors are used to instantiate objects.
-
What Is Python's init.py For? - Real Python - Understanding how to effectively use init.py helps you structure your Python packages in a clear, maintainable way, improving usability and namespace management.
-
Python's init() Method - Live Python - This 8 minute tutorial provides a succinct explanation of Python's init() method, which'll be the only one you ever need!
-
Why init.py File is Used in Python Projects - 2MinutesPy - This video peels back the layers to reveal the secrets of the "init.py" file and why it plays a crucial role in your Python packages.
-
What does 'init.py' do in Python? - Tech with Tim - If you've read a fair amount of Python code, then you've probably seen this "init.py" file pop up quite a few times. It's especially common in larger Python projects. This video breaks down exactly what this file is, when you should use it, and exactly how it works.
-
python-package-quickstart - michaelcurrin.github.io - This is a simple template for a Python project that can be installed with pip. It includes docs and a tutorial.
-
How to Write Correct init.py Files for Python Packages - PythonTutorials.net - This guide demystifies init.py, and it explores its core roles, best practices for structure, the critical all variable, and real-world examples with subpackages. By the end, you’ll be able to craft init.py files that make your packages more usable, maintainable, and professional.
-
Variables in Python – Real Python - This site gives you an in depth description of the different types of code that can be written using variables. It also provides examples of each way showing both the written out code and what will be printed out after the code is run.
-
Python Variables - GeeksforGeeks - For this site, be sure to check out the "Rules for creating variables in Python" (near the top). This list is a very handy reference to remember or refer back to. It also comes with some basic examples, where you can try out some code!
-
Python: Variable Types - Tutorialspoint - For this site, although the language is more advanced in this article, it does a great job at thoroughly explaining every detail about Python variables. It also provides examples of code written as well as what that code returns once it is run.
-
Python Variables - guru99.com - This site provides a description of the many ways that you can write variables, and also describes what it does. It also provides examples of code, pointing out the what each line does and how it interacts with the variable that was created.
-
Variables and Types - Learn Python - This site gives a description about what a variable is, and the many ways in can be used in code. It also provides examples of all the different types of variables, and it allows you to change the code and see what changes when the code is run!
-
Python Tutorial: What Are Variables? - CS Dojo - This video talks about how to use the print function to print out the values held in variables. It also provided an example of using variables and printing them out, and the step-by-step process on how to do that in Python.
-
Python 3 Tutorial: Variables - sentdx - In this video, he describes that variables act as placeholders for data. They can aid in short hand, as well as with logic, as variables can change, hence their name. He then provides examples of using variables in Python and that process.
-
Python Variables - Programming with Mosh - This video talks about what variables are and how to use them in Python. He gives a step-by-step example of the different functions of a variable like assigning a value to it, as well as printing that value and variable out as a part of the output.
-
Variables in Python - Telusko - In this video, he described what a variable is, as well as how to use them in Python. Then, he described an example talking about adding a string value to a variable, and also finding the length of that string when it is within the variable.
-
Python Variables - python-ds.com - This site gives you both a simple example of what a variable is and how it is used, and it also gives more complicated examples of real life use for variables. For some of the examples you can change the code and see how that changes what is printed out.
-
Python Variables - w3schools.com - This site's explanation of variables is a little more advanced, as it compares Python variables to how variables are handled in other programming languages. It also includes a tutorial for you to try out some of the lessons.
-
While Loop - Stanford/Nick - This is a description of how while loops are used in Python presented by Stanford University.
-
Python While Loops - Real Python - This is an article from Real Python describing the behavior of while loops and why we use them.
-
Python While Loops - W3Schools - This article explains Python While loops and gives examples of common scenarios.
-
Python While Loops - Visually Explained - This is a short 10 minute video on while loops in Python.
-
While loops in Python - Bro Code - This is a video about while loops in Python.
-
Python While Loop Guide: Syntax & Examples - Pytutorial - This article will teach you everything about the while loop. You will learn its syntax, see practical examples, and understand how to use it effectively. It also covers common pitfalls like infinite loops.
-
Python Loops Explained: for, while, break, and continue - OpenPython - This guide covers Python's for and while loops, when to use each, and how break, continue, and else work inside loops.
-
Python Event-Driven Programming - GeeksforGeeks - This is a GeeksforGeeks page on how to use Events with various libraries in Python.
-
Pygame: Event Handling - GeeksforGeeks - In this article, you learn a few important attributes of the common event types used in Pygame.
-
Python Pygame Event Get Guide - PYTutorial - This guide will explain how to use
pygame.event.get()effectively. It will also provide examples to help you understand its usage in game development. -
[Events in Python - Medium(https://medium.com/@idelossantosruiz/events-in-python-e2b3cb76ac2d) - This article explains the concepts and implementations of event-driven programming.
-
How Does Python Event Handling Work? - Python Code School - This is a short video on how events work in Python
-
Pygame Event Handler Explained - Coding with Russ - This video demonstrates the different events in a basic Pygame program to see how they work.
-
Event in Python - Delft Stack - This guide is an additional resource on Events in Python. This will show you examples of how to handle events with various Python libraries.
-
How can I trigger and listen for events in Python? - DEV Community - Triggering and listening for events in Python can be implemented using various approaches. Here are some methods to implement event-driven programming.
-
Keyboard events - pythonhosted.org - This site gives you the different commands that are considered "key events" where a key is pressed. It also goes more in depth than the challenges for this course talking about modifiers and how they interact with key events.
-
Pygame.key - pygame.org - This site gives you a list of all the different pygame.key commands that can be used in Python. Then, after the list, it describes what pygame.key means and where it can and should be used in code. Then, there are examples of some of the ways that pygame.key can be used.
-
Keyboard Input Events - coderslegacy.com - This site gives an in depth description of the different aspects of a key being pressed and the code that can be used to make that command. It also gives examples of code for each of those aspects and how it looks written out.
-
Pygame Programming - nerdparadise.com - This site gives a description of a few of the key event commands, as well as a brief description about what they mean. Then, at the bottom there is an example of the key events described used in a code example as well as other key events.
-
Python Turtle Graphics: Key Presses & Events - Tech with Tim - In this video he continues his tutorial on the turtle module in python. The turtle graphics module has built in functionality to listen to events and detect key presses. This allows the ability to move the turtle object via user input and create some interesting shapes.
-
Python GUI keyboard events - Bro Code - This video goes more in-depth describing the keyboard events and presses using GUI. He provides a step-by-step example of this process, and how it works specifically in Python. He also described some of the things that will not work while using GUI.
-
Keyboard Event Binding with Python Tkinter - Codemy.com - In this video, he describes how to do and write keyboard events using binding with Python in Tkinter. Binding allows us to grab keyboard and mouse events...so mouse clicks (left or right mouse clicks), keyboard presses (Say, if you pressed the q key on your keyboard) and much more.
-
Pygame.KEYDOWN Example - programcreek.com - This site gives an example of specifically the pygame.KEYDOWN function, and the code commands that work for that function. However, there are other examples as well that use other key event commands.
-
Pygame.KEYUP Example - programcreek.com - This site is the same as the previous link, this one focuses on the pygame.KEYUP command. However, just like the last one, there are other key events that are used as examples throughout the site as well.
-
Python Conditions and If Statements - w3schools.com - This site first gives a description of what an if statement is and how it can be used. Then, it gives a few examples of code commands using if statements with the printed out result below it to see what each if statement did.
-
Python If Else With Examples - pythonguides.com - This page talks about the Python if statement, if-else statement, elif statement, and also the nested if statment. It also provides examples of each of these statements in a Python program.
-
How to Use the Python if Statement - makeuseof.com - This page provides an in-depth descriptions of the different kind of if statements that can be used in Python programs. It also provides examples of these statements in Python programs and describes each section.
-
If Statements - anh.cs.luc.edu - This site gives a description of the different ways that you can use and set up an if statement. For each of these ways that this site describes, it gives a short example of the different types of code where an if statement can be used.
-
If Statements Explained - pythonbasics.org - This site gives a brief description of what an if statement is and the different ways that it can be used as a code command. It uses Boolean expressions which just means true or false, which is the most common use of an if statement. This site also talks about other conditional statements that you will use in future levels.
-
Python If Statement - beginnersbook.com - This site gives a description of what an if statement is, as well as a diagram of how an if statement works, once again using the Boolean commands. Then, it gives you some short examples of how to use if statements.
-
Python Conditional Statements - realpython.com - This site gives descriptions of all the different types of conditional statements, however it starts with just the if statement. Along with the description of an if statement, this site provides an example of code using an if statement.
-
Python's if statement explained - kodify.net - This page gives a description of what if statements are and how they are used in Python. Then, it provides written out coded examples of programs using if statements, with a description of each section that uses if statements.
-
How to Use If Else Statements in Python - CS Dojo - In this video, he describes how to use if statements and if else statements in Python. He also provides coded examples that he goes through and writes out himself that show how to use these statements in a Python program.
-
Python 3 Tutorial: If Statement - sentdex - In this video, he describes that the if statement is one of the most basic forms of logic that can be introduced into your program. The idea of the if statement is to assess whether something is the case, and, if it is, then to perform the following block of code within the statement.
-
Python: If Elif Else Statements - Programming with Mosh - In this video, he gives an in-depth description on what if-else statements are and how they work in Python. Then, he also provides an example of a program that uses these statements and what each of the parts mean.
-
If Elif Else Statement in Python - Telusko - This video gives a brief description of the different types of statements used in Python such as If, Elif, and If-Else, and also gave examples of each of these in a Python program. He describes each line and command and how they use these statements.
-
Python If Statements - Amigoscode - In this video you will learn how to work with Python if statements and the different command for it. He provides different examples of these statements being used in Python programs, and describes what they mean and what the output will be.
-
Python If Conditions with Examples - tutorialsteacher.com - This site gives a little bit of a description of what if statements are, however there are mainly examples. It shows the use of the if statement in the input area, and then under that, in the output area, it shows you the result of the code commands.
-
Python: if-statement – thispointer.com - This site gives a little bit of a description of what if statements are, however there are mainly examples. It shows the use of the if statement in the input area, and then under that, in the output area, it shows you the result of the code commands.
-
Python Output/Print - W3Schools - This article shows a very basic way to start displaying text in Python. Here, you will learn how to print text to the console.
-
Input and Output - Python.org - This is the official Python website on how to display text OR write text to a file.
-
print() and Standard Out - Stanford - This is an article discussing print() in Python and its differences from Return and Print to File.
-
Display text to Pygame window - GeeksforGeeks - This is a basic tutorial on how to display text in Pygame windows.
-
Python Display: A Comprehensive Guide - Code Drivers - This guide delves into the various aspects of Python display, from basic text output to advanced formatting with the standard library's pprint module, modern terminal output with the rich library, and interactive displays in Jupyter Notebooks.
-
Displaying Text on The Screen In Pygame - Coding With Russ - This is a video on how we display text in Pygame. Displaying text in our IDE (Integrated Developer Environment) like Visual Studio Code is relatively easy, but displaying text in a game is more complicated.
-
Learning Python: Displaying text with Pygame - Paul Baumgarten - This seven-minute video is an end-to-end tutorial that continues in a series of using graphics with Pygame.
-
How to Display Data in Textboxes using Python Tkinter? - Python Guides - In this tutorial, the author explains how to display data in textboxes using Python Tkinter.
-
Simple way to display text on screen in Python? - Stack Overflow - The community offers a few different options.
Next, you can check out the rest of our Level 2 resources. When you're done with Level 2, you can move on to Level 3, the Classroom Quiz!
In addition to this Online Articles page, you should check out the Level 2 Help page (if you haven't yet). We also have two challenges (to learn even more), a Learning Quiz (to test what you've learned), an Unplugged Activity, and a Rewards article:
-
Level 2: Help - This page will guide you through developing the Level 2 application, with some details that are in addition to what we're talking about in class.
-
Level 2: Challenge 1 - For this challenge, you're going to add two more introductions to your app... one for RAM & ROM (the twins presented together) and one for Amphib Ian (totaling 14 introductions). This page will guide you through the additional code that you'll need to write.
-
Level 2: Challenge 2 - This challenge will show you how to build your code using a Python list of variables, rather than an If/Else Ladder (like we used in class). This page walks you through the new code in the challenge.
-
Level 2: Learning Quiz - These questions are for a quiz you can take that will tell us what you've learned from today's assignment.
-
Level 2: Unplugged Activity - It's important to get some exercise and to think of coding from a fresh perspective. In today's Unplugged Activity, you're going to play a game with the class, in order to remember what variables are. This page will show you how to play the game!
-
Level 2: Rewards - If you're able to complete the class assignment in our book, then we want you to access this page as a reward, in order to see all the exploratory art and backstory for how we created the Class Introductions program! In addition, I provided the Apple Award emblem as a digital download, on this page. This is for you, if you completed the Level 2 program! You can print it out as an award, to physically show your progress through the book, to your family and friends!
After you're completely done with Level 2 (did you do the challenges?), then it's time to move on to Level 3! While you read through Level 3 in your book, you can check out the resources from Mrs. Codala, as she teaches you how to build the Classroom Quiz program:
Hopefully, you learned some more about variables, key events, and if statements. You'll use these lessons in all your future classes and projects. The more you learn, the easier programming becomes.
-- Mrs. Scratcher