Let’s Code!

Grow your Python skills with detailed courses and articles that solve real-world problems.

Spotlight

Solving Wordle Puzzles with Basic Python

The Wordle puzzle game is deceptively simple - you get six tries to guess a five-letter English word, with hints if you get it wrong. Here’s how you can write an iterative solver that suggests words based on letter frequency and hints using nothing but pure Python.

Let's Write a Game Boy Emulator

Remember the Game Boy? Have you ever wondered what it would take to build an emulator capable of running Game Boy cartridges? Let's write one and find out!

Illustration of the Game Boy handheld games console

Latest Articles

Solving Wordle Puzzles with Basic Python

The Wordle puzzle game is deceptively simple - you get six tries to guess a five-letter English word, with hints if you get it wrong. Here’s how you can write an iterative solver that suggests words based on letter frequency and hints using nothing but pure Python.

Game Boy Emulator: Designing the CPU

With a working instruction decoder, it’s time to think about how we represent the Game Boy’s CPU in software; what CPU registers are; and a quick primer on bitwise operations.

Five Advanced Pytest Fixture Patterns

A close look at five pytest fixture patterns that will teach you just how much you can accomplish with pytest’s fixtures decorator

Inspired Tips

Inspirations for busy people

Inspired Python
Picture of a coiled snake and the main logo of Inspired Python
def current_datetime(dt = datetime.datetime.now()):
    print(dt)

>>> current_datetime()
2021-10-09 16:09:43.009959
>>> current_datetime()
2021-10-09 16:09:43.009959

Python Anti-Patterns: Argument Side Effects


Be extra careful if you assign the result of a function call to a default argument. Python evaluates argument defaults on module load, so if your function is non-deterministic or has side-effects, you could run into trouble. As the example shows, the printed time is frozen; it was set once when the code was first evaluated.

Be Inspired Get Python tips sent to your inbox

We'll tell you about the latest courses and articles.

Absolutely no spam. We promise!