Python Simple Dice Game

Here’s a simple program in Python that demonstrates some important fundamental concepts in computer programming. The program simulates two players taking it in turns to roll a 6-sided dice, and keeps track...

User Login with Python and SQLite

In this lesson you will learn how to create a basic login script with Python and SQLite. SQLite is ideal for small-scale data-driven Python applications. It is a lightweight, self-contained, serverless database...

The Stack Data Structure in Python

The stack is a wonderfully simple data structure which despite its simplicity makes many powerful algorithms possible. Some of the uses for a stack data structure in software development are: The Depth-First...

Python Programming – List Mutation

A Surprising Feature of Python Lists What do you expect the output of the following Python code to be? def mutate_or_not(a_list): a_list[0] = "I've changed" my_list = [1, 2, 3] mutate_or_not(my_list) print(my_list)...

Colourful Formatted Tables in Python

This post is written for readers with different levels of experience with Python programming and also with Mathematics. Depending on your experience and interest, you will get different things from reading it....

Python Bitwise Operators

Bitwise operators and bit manipulation are like recursion in that they are both topics that are fundamental to computing, yet the amount of use you will make of them will vary gratly...

Python Dictionaries

Some Python developers would say that there are two fundamental data structures which form the basis of the language: lists and dictionaries. Whether or not that is true, they are both certainly...