Programming with Python

It’s been an intense year for our junior youth at Rata Studios.  Term 1 found them creating graphics and planning levels for a future video game.  Terms 2 and 3 had them building their own video games from scratch with the Python programming language.

All students had some previous coding experience, whether with Scratch, HTML, or some basic Python, but the past two terms stretched them considerably with awesome results.  In Term 1 students were walked through the basics of coding with Python, starting with creating a simple dice roller game and simple drawings with Turtle, before moving on to creating platform games using PyGame.

 

Previous knowledge of coding via Scratch gave students the vocabulary and basic logic skills to understand what was happening with Python, even if the process was a bit different.

The three most important terms we learned in Python were:

Class – an object containing variables and functions useful for the class.  (Player and Enemy are examples of classes)  We use classes to help make our code more organised.

Screen Shot 2017-09-25 at 1.14.37 PM

Function – usually, but not always, goes inside of a class.  Functions can be called later on in the code.  All functions begin with the keyword def, for define.

Screen Shot 2017-09-25 at 1.15.16 PM

Variables – a value we don’t know yet and/or a value that can change

At the end of each session code was uploaded to the GitHub website.  Students learned how to commit their changes as well as file and resolve issues.  When creating issues it is important to be very specific so the reader understands what isn’t working in the code.  The best bug reports require an understanding of what is going wrong in the code and a strong description of how the issue is presenting itself.

“What is GitHub actually used for?”
                               – Finn

GitHub is used by professional programmers exactly the way we used it in class, to store, share, and fix code!  Students interested in working as programmers should continue to use their GitHub accounts as it will be an asset when they apply to future jobs.  Contributing to other user’s GitHub projects is also an excellent way to increase your programming skills.

By the end of Term 2 students began to see patterns in their code.  Term 3 took a significantly more self-guided approach where each student worked at their own pace and were encouraged to think critically about the code needed to further develop their games.  There was much protest the day we stopped providing answers and began providing open ended prompts, no one thought they would be able to create loot entirely on their own.  After a few false starts, students started collaborating with each other, trading knowledge, and working off each other’s strengths.  Once a small handful of students figured loot out, they were able to assist others who were still stuck.

This is what coding is all about.  No one is naturally good at programming and it’s impossible to memorise every keyword, but through practice, collaboration, and asking heaps of questions we learn how to think logically and find the answers to our problems.

When we began this series of courses I honestly wasn’t sure how it was going to go, but now that we are at the end I couldn’t possibly be prouder.  The students produced amazing work over these three terms and showed real commitment and dedication to their individual projects.  It takes a great deal of effort to commit to a project for such a long period of time, but they tackled the challenge head on with excellent results.

All code created this term is available on GitHub under a GNU General Public License.  You can view all our repositories at: github.com/MakerBox-NZ

 

 

One thought on “Programming with Python

  1. Hi Jess
    Wow that was a really interesting read. you spend an enormous amount of time planning the course and clearly enjoy your students. We feel extremely lucky that George is part of it. Look forward to hearing how next term goes.

    Kind regards Janet

What do you think?