The Python Coding Programme: A Live Course for Beginners With Small Cohorts & Active Mentoring

The Python Coding Programme logo

Writing on these pages is not enough. I want to meet you, interact with you, answer your questions, discover new things with you. That's why I'm launching The Python Coding Programme. It's not just any Python beginner's course—it's an active mentoring programme with live sessions. It has very small groups and a private forum to… Continue reading The Python Coding Programme: A Live Course for Beginners With Small Cohorts & Active Mentoring

What’s a Python Sequence? [Python Data Structure Series #2]

Image of wooded boxes — used in article on Python sequences

Note: This article has now moved here: Sequences in Python (Data Structure Categories #2) – Sequences are different from iterables • Part 2 of the Data Structure Categories Series Here's an introduction to the article: You started your journey through Python's main data structure categories in the first article in this series, which dealt with… Continue reading What’s a Python Sequence? [Python Data Structure Series #2]

Anatomy of a 2D Game using Python’s turtle and Object-Oriented Programming

2D Python game

When I was young, we played arcade games in their original form on tall rectangular coin-operated machines with buttons and joysticks. These games had a resurgence as smartphone apps in recent years, useful to keep one occupied during a long commute. In this article, I'll resurrect one as a 2D Python game and use it… Continue reading Anatomy of a 2D Game using Python’s turtle and Object-Oriented Programming

Understanding The Difference Between `is` and `==` in Python: The £5 Note and a Trip to a Coffee Shop

Coffee cup and a £5 note to show difference between 'is' and '==' in Python

The keyword is and the operator == are not the same. Yet, many programmers often use one when they should use the other. Let's look at the difference between is and == in Python with the help of a £5 note and a trip to my local coffee shop. In this article, you'll: Find out… Continue reading Understanding The Difference Between `is` and `==` in Python: The £5 Note and a Trip to a Coffee Shop

Some Best Practices When Writing Python Functions [Intermediate Python Functions Series #7]

You've covered a lot of material in this Intermediate Python Functions Series. In this final article, you'll read about some best practices in Python functions. This topic is different from the previous ones discussed in this series. You won't get a SyntaxError, TypeError or any other error if you don't follow best practices. Your code… Continue reading Some Best Practices When Writing Python Functions [Intermediate Python Functions Series #7]

Using Type Hints When Defining A Python Function [Intermediate Python Functions Series #6]

You've already covered a lot of ground in this Intermediate Python Functions series. In this article, you'll read about a relatively new addition in Python called type hinting or type annotation. Unlike all the other topics you learnt about in the previous articles, this one will not change the behaviour of the function you define.… Continue reading Using Type Hints When Defining A Python Function [Intermediate Python Functions Series #6]

Write A Football Offside Rule Quiz in Python While Practising Object-Oriented Programming

Offside Rule Python Quiz: silhouette of player kicking the moon

Do you know the offside rule in football*? Or do you want to test whether someone else knows it well enough? Either way, it's time to write an offside rule quiz in Python using object-oriented programming. (*Some of you may call it "soccer") Here's what the quiz will look like. The program presents you with… Continue reading Write A Football Offside Rule Quiz in Python While Practising Object-Oriented Programming

Optional Arguments With Default Values in Python Functions [Intermediate Python Functions Series #3]

Steampunk hat with goggles

We continue our journey through Python functions by looking at optional arguments and default values. In this article, you'll see how you can define a function with an optional argument. A default value is used if the argument is not included in the function call. Overview Of The Intermediate Python Functions Series Here's an overview… Continue reading Optional Arguments With Default Values in Python Functions [Intermediate Python Functions Series #3]

Using Positional Arguments and Named or Keyword Arguments in Python Functions [Intermediate Python Functions Series #2]

Image of steampunk gears used to represent Python functions

In the first article in this Intermediate Python Functions Series, you made sure you got your terminology right. So you know what an argument is. But what are positional arguments and keyword arguments in Python? In this article, you'll see how you can choose to use either of the two in many situations. Later in… Continue reading Using Positional Arguments and Named or Keyword Arguments in Python Functions [Intermediate Python Functions Series #2]

Moving On From The Basics of Python Functions [#1 in Intermediate Python Functions Series]

Steampunk-themed cogs to represent Python functions

Those learning to code learn about functions very early on in their journey. Not only do beginners use Python functions right from their first lesson, but they also learn to define their own Python functions early on. It may be tempting–and in my experience, it's a common pitfall early on–for a relative beginner to think… Continue reading Moving On From The Basics of Python Functions [#1 in Intermediate Python Functions Series]