## Python Loops and Flowcharts

In this lesson we are going to learn how to convert between Python code and flowchart representations of loops when designing algorithms. Consider the following code. As with most code examples in...

## Computer Science Pedagogy

This post is a work in progress where I will collect pedagogical tips about teaching Computer Science distilled from my 15+ years’ teaching experience. They are phrased as advice to teachers, but...

## 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...

## Python Programming Challenge – Counting Pairs

Here’s a fun algorithmic challenge for you. Given a list of integers, write a function to find the total number of complete pairs contained in the list. For example: for the input...

## Python Trace Tables

The ability to trace the values of variables during program execution is a great aid in ensuring your code is doing what it is supposed to do and in avoiding logic errors...

## Musical Bubble Sort in Python

I am a firm believer in offering a wide variety of perspectives on the topics I teach in Computer Science. I also like to make connections between Computer Science and other subjects....

## 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 Databases – SQLite Tutorial Part 1

Working with databases is a fundamental skill in software development. In this article we will look at how to work with databases in Python using SQLite. SQLite is a library that provides...

## 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)...