CoderDojo Twin Cities Python Resources¶
This GitHub repository is for sharing teaching resources to teach Python. This includes hints on getting your Python environments setup up and extensive lesson plans for serveral enviornments.
Our mentors have used several different envornments for teaching Python. They each have pros and cons. What our mentors like is getting new students started using a graphical programming environment such as turtle graphics libraries. Here are some of our favorite tools:
- Trinket.io is an easy-to use, kid friendly web-based turtle graphics for beginners.
- Jupyter Notebooks also have some support for turtle graphics. Jupyter Notebooks can be tricky to setup for the first time, but they are the perfect on-ramp for teaching data literacy.
- Raspberry Pi - The Raspberry Pi foundation has selected Python as its primary tool for teaching programming. If you have a Raspberry Pi there are many resources for you. Trinket and Jupyter Notebooks will also run on many Raspberry Pi devices.
- Robots Our students love robots. Python is also the preferred language in many robotics courses. Today we teach beginning robotics with Scratch and Arduino, but we continue to investigate systems like Raspberry Pi robots that can be programmed with Python. Let us know if you have any low-cost kid friendly ideas. We have tested the JetBot and other robots and we continue to look for solutions.
Now lets briefly go into the pros and cons of these systems.
Learning Python with Trinket¶
We use the trinket.io web site to teach our introduction to python. Trinket has a nice turtle graphics library which is ideal for fast visual feedback. Because it is a free and a pure web web based environment it meets the criteria for our courses. There is no complex setup and each student can continue to do development when they are at home. The downside of Trinket is it has limited functionality, only supports Python 2.X in the free version and you must have an internet connection to use Trinket. If you need Python 3.X web version you can use the free repl.id web site.
Learning Python with Jupyter Notebooks¶
You can also use Jupyter Notebooks to draw turtle graphics. The notebook will open a new window to draw your turtle graphis. Getting Jupyter Notebooks is a bit tricky to setup on many PCs. However, once it is setup it offers tens of thousands of sample programs to learn python coding. Jupyter Notebooks are also the preferred tool by many data science professionals. An example of a Jupyter Notebook that uses turtle graphs is here
Learning Python with Raspberry Pi¶
If you have a Rasperry Pi there are many great ways to learn Python. One of first things is to try out one of the Python development environments for the Raspberry Pi.
Learning Python with Robots¶
Right now we are continuing to try to find the right combination of easy-of-use and low-cost robots to teach python. If you hear of any good tools, please let us know.
Learning Python is ideal for students that have good keyboarding skills. If students have difficulty with doing functions like copy and pasting text we suggest they start with a block-programming language like Scratch.
List of Concepts¶
Here are some of the concepts we will be learning in this course. If you are already familiar with these concepts you can skip over some of the labs.
- importing libraries We need to tell Pyhton what functions we want to use. We will use the import function to tell Python which functions we need to use in our programs.
- drawing Turtle graphs has a set of drawing functions. We will learn to use these to draw patterns on the screen.
- square walk - teach your turtle to walk in a square and draw figures.
- variables Variables make our programs easier to read and easier to understand.
- loops Loops help use when we have many tasks that we repeat over and over.
- conditionals Conditionals allow us to change our behavior based on rules we create.
- functions Functions allow us to break large programs into chunks that we can give names and can call over and over.
- function parameters Functions can also take parameters to change the behavior of a function.
- random numbers Random number functions allow our programs to have the computer select new random number between a range of numbers.
- lists Lists alow us to create collections of names.
- inputs Inputs allow us to prompt the user for values.
- recursion Recursion allows us to have programs call themselves to create repeating patterns.
- modules Once you have a group of related functions you can put them all together into a module. This makes it easier for others to reuse your programs.
Contributing to Our Library¶
- Do you have a specific example you would like to share with other students and teachers? Please see the Contributing menu for details on how to share your code.