Level 7: Online Articles - IncrediCoders/Python1 GitHub Wiki

Grafika Turtle added this page on June 6, 2023


This page will give you helpful resources with more information on creating classes, random functions, and state machines! You can skip down to these sections on the page:

More About Creating Classes

Here's the definition of class, which I sent you in our text conversation:

Class: You can organize your program in sections so that you don't have to repeat your code, and you can then call the class when you need it (in Python, it's an object). In other words, a class is a template that creates a new object and might include methods and variables.

Check out these articles, which explain how classes work in Python:

  • Understanding How Python Class Works - bitdegree.org - This site gives a brief definition of what a class in Python is and how it works. Then, it describes each of the steps to create a class in Python and also provides coded examples for each of these steps.

  • Python Classes and Objects - geeksforgeeks.com - This page provides an in-depth description of what a class is providing coded examples within the definition. Then, it goes into the different parts of classes, and how to build a class, also providing coded examples in each of these steps.

  • Python Objects and Classes - programiz.com - This site gives a description on the core functionality of objects and classes in Python. It gives both a definition of a class and creating class, as well as, how to create an object in Python with coded examples in each section.

  • Python Classes - docs.python.org - This site gives a more in depth summary of classes and the different parts of classes in Python. It goes into detail about names and objects as well as scopes and namespaces, and gives a definition of them, and explains how they are used in Python.

Class Creation Videos

  • Python Classes and Objects - Socratica - This video goes into detail about classes in Python and teaches about the essentials of programming with classes in three main ways which are how to initialize them, write methods, and store fields, while providing coded examples for each of them.

  • Object Oriented Programming Tutorial - Keith Galli - This video talks about the basics of object oriented programming, defining a class in Python, class methods and finally inheritance and subclasses, also providing examples for each of these things and describing what those examples mean.

  • Python Classes - edureka! - This video will help you understand Python Classes and Objects with examples. It will also explain the concept of Abstract Classes and Inheritance in Python. The examples it provides are written out coded examples, and it explains what each part of it means.

Class Creation Examples

  • Write a Class in Python - wikihow.com - This site starts with a brief description of what a class is in Python. Then, it goes into a step-by-step process with a description and coded examples for each of the different steps needed to create a class in Python and what they mean.

  • Python Classes and Objects - w3schools.com - This site gives a brief description on what a class is in Python. Then, it gives a description with coded examples about how to create a class, create an object, and also how to use the "init" function, and what it means in Python.

More About Random Functions

A Python random function generates indiscriminate numbers. You use this in order to make a random decision, like a coin flip (in our case, for IncrediCards).

Check out these articles, which show you a few options of how to randomly generate numbers in Python:

  • Python Random Module - tutorialsteacher.com - This site gives a brief description on the different ways that you can use the random function in Python. It provides coded examples for generating random floats and integers, and also how to randomly shuffle numbers.

  • Python Random Functions - tecadmin.net - This site is a question and answer page, and the question posed is "What are the random functions in Python?" Then, the answer provides a list of the different functions, and then below it coded examples of each of those functions being used.

  • Random Module - w3schools.com - This site provides all of the different random module functions as a list in a table with a brief description of each of these functions beside it. If you click on the function, it will take you to a page to learn more about that specific function.

  • Random Number Functions in Python - tutorialspoint.com - This site gives a brief description of the different random functions, listing them and then providing definitions. Then, you can click the arrow next to each function and it will take you to a page with more details on that function.

  • Generate Pseudo-Random Numbers - docs.python.org - This site gives an in-depth description of the different random functions in Python. It also describes the functions used for the Random class, and also links on some of the words that give more detail on what they mean and how they relate to a random function.

Random Function Videos

  • Python Random Function for Beginners - Arsenio Scott - This video gives a basic description of how to use the random function in Python. It also provides several written out coded examples that show each of the different functions that are used for random classes.

  • How To Build a Random Number Generator In Python - Wild Rice - This video provides a basic example on how to build a random number generator in Python. It describes each of the steps and how they use the random function or support a random function, and in the end it creates a random number generator program.

  • Python Random Number Generator - Socratica - This video gives a more complex example on how to create a random number generator. It describes the different parts of the program, and how they use the random functions, and in the end it creates a random number generator program.

Random Function Examples

  • Random Numbers in Python - geeksforgeek.org - This site gives a brief description of the random number operations. Then, it provides several in-depth coded examples of each of the different random functions and it describes the different parts of each example.

  • Random Functions in Python - geeksforgeek.org - This site gives a brief description on what the random functions are in Python. Then, it provides several coded examples of the different random functions with descriptions of each part and how they use random functions.

More About State Machines

A state machine is an initial set of states, or screens/modes in our case, which get updated from the user input. It reads multiple input events and updates the screen.

Check out these articles, which help you understand state machines:

  • State Machine - readthedocs.io - This page gives an in depth description of state machines and how they work in Python. It also provides a couple of written out coded examples that use state machines, and it describes each line's meaning.

  • Building a Simple State Machine in Python - dev.to - This page goes into the many different parts of a state machine. It talks about state machines, how to use a state machine, and use cases and provides coded examples for each of these sections.

  • Writing Maintainable Code Using State Machines - zeolearn.com - This page provides solutions for writing stable backend systems. For each solution, there is a written out coded example that uses the solution and it describes what it means and how it creates that stable backend system. This page also describes pytransitions which is something you do not need to know for this level, but is still interesting to look at.

  • Finite State Machine - wikipedia.org - This page goes in depth into finite state machines. There are many different types of state machines, finite being one of them. There are also several other links embedded in the page for key words that will take you to another page specifically about that key word.

  • Python State Machine Design - stackoverflow.com - This is a question and answer forum, and the question asked was about building a stable Python state machine. The answer given is an in depth description of a coded example of a solution to the question.

State Machine Videos

  • Finite State Machines - Trevor Payne - This video talks about what a Finite-State Machine (FSM) is, how to plan one out, and how to create two different ones and the reason they are used. There are several coded examples that are shown in this video that help explain these things.

  • Using Finite State Machines for Pattern Matching - Valhalla Data Systems - This video explains the concept of Finite State Machines in detail, and also provided a written out coded example of one. As it goes through each line of code, it describes the relation and connection to the Finite State Machine.

  • Python Finite State Machines Using Enums - AtiBytes - This video shows the step-by-step process on how to build a Finite State Machine in Python. It walks you through the code for this program, describing each part and its connection to the overall program creating the Finite State Machine.

State Machine Examples

  • Python State Machine Examples - readthedocs.io - This page provides several lines of code that show examples of the different parts of a state machine in Python. There are also brief descriptions in between chunks of code to show how the lines relate to the state machines.

  • Simple State Machine - readthedocs.io - This page is similar to the last one, except this one focuses on simple state machines. There are several lines of code with descriptions of these chunks of code in between describing their connection to the overall simple state machine.

Next Steps

Next, you can take on the two extra challenges to build the IncrediCards and learn more!

Take the Challenges!

  1. Challenge 1: In this challenge, you are going to...

  2. Challenge 2: In this second challenge, you are going to...

More Level 7 Resources

In addition to this Online Articles page and the instructions for our Level 6 challenges, we also have a Help Page, a Learning Quiz, an Unplugged Activity, and a Rewards article:

  • Level 7: Help - This page helps you complete the instructions in the book, in case you get stuck.

  • Level 7: Learning Quiz - I wrote some questions in case you want to quiz yourself about what you learned. Or you can teach others and quiz them!

  • Level 7: Unplugged Activity - I wrote this page with more details than what you saw in the book. In this game,

  • Level 7: Rewards - If you completed the IncrediCards program that we talked about, then I set up this page to act as a reward. You can see some illustrations of me and learn more about who I am! You'll also find the WHAT Award digital download, to show off your accomplishment!

Level 7

After you're completely done with Level 6 (did you do the challenges?), then it's time to move on to Level 7! While you read through Level 7 in your book, you can check out the resources from CHARACTER, as he teaches you how to build the IncrediCards program:

I hope you had fun learning about the Creeper Chase!

--Queen Cobra

⚠️ **GitHub.com Fallback** ⚠️