Shallow and Deep Copy in Python and How to Use __copy__()

Stormtroopers to show shallow and deep copy in Python

You need to make a copy of an object in a Python program. How difficult can it be? Not very. But you also need to know the difference between shallow and deep copy in Python and decide which one you need. In this article, you'll read about the difference between shallow and deep copy when… Continue reading Shallow and Deep Copy in Python and How to Use __copy__()

Sunrise: A Python Turtle Animation Using Named Tuples

Flower in sunrise to illustrate a Python turtle animation using named tuples

You may think the Python turtle module isn't useful for anything. "It's just for kids", is what many think of it. However, this module allows you to explore and experiment with many areas of Python. In this article, you'll write a Python turtle animation of a sunrise scene using named tuples: https://videopress.com/v/OgwI5VyJ?resizeToParent=true&cover=true&preloadContent=metadata&useAverageColor=true As you work… Continue reading Sunrise: A Python Turtle Animation Using Named Tuples

Debugging Python Code Is Like Detective Work — Let’s Investigate

Sherlock Holmes in Debugging Python code

Debugging Python code is not a mysterious art form. It's like a detective solving a mystery. This analogy comes from one of my favourite programming aphorisms: "Debugging is like being the detective in a crime movie where you are also the murderer" (Felipe Fortes). So what can real detectives tell us about debugging Python code?… Continue reading Debugging Python Code Is Like Detective Work — Let’s Investigate

Understanding Two-Point Perspective Drawing using Python

Have you ever struggled to truly understand a topic? Perhaps one related to your work, or maybe linked to a hobby? Writing a computer program to investigate the subject can often help you get that extra level of understanding you're looking for. I've often used this method to understand fairly abstract physics concepts in my… Continue reading Understanding Two-Point Perspective Drawing using Python

How Do They Build The Starships in Star Trek? Classes and Objects in Python

Star Trek Spaceships in a Wormhole

With so many new Star Trek series coming out at the moment and in the near future, new and old Trekkies are all asking the same question: How do they build the starships in the Star Trek universe? Or maybe it's just me? This article will boldly go on a journey through classes and objects… Continue reading How Do They Build The Starships in Star Trek? Classes and Objects in Python

Simulating a 3D Solar System In Python Using Matplotlib (Orbiting Planets Series #2)

One of the uses of programming is to help us understand the real world through simulation. This technique is used in science, finance, and many other quantitative fields. As long as the "rules" which govern the real-world properties are known, you can write a computer program that explores the outcomes you get from following those… Continue reading Simulating a 3D Solar System In Python Using Matplotlib (Orbiting Planets Series #2)

Practise Using Lists, Tuples, Dictionaries, and Sets in Python With the Chaotic Balls Animation

Using lists tuples dictionaries and sets in Python

One of the early topics covered when learning to code deals with the built-in data structures in Python. Lists are usually learned early on, followed by dictionaries and tuples. Sets are not normally one of the earliest topics covered. However, that's not because they're complex but because they're used less often in Python. Understanding the… Continue reading Practise Using Lists, Tuples, Dictionaries, and Sets in Python With the Chaotic Balls Animation

Python Readability, the PEP 8 Style Guide, and Learning Latin

Latin and Python Readability

Over the past couple of years, I've decided to start ticking things off my lifetime to-do list. We all have things "we'd like to do at some point when we have time." I finally started carving time out of my days to do these things. In the past two years, I've learned touch-typing (that's right,… Continue reading Python Readability, the PEP 8 Style Guide, and Learning Latin