Factorial Function in Python

Exploring different approaches to calculating the factorial of a number is a great way to develop your algorithmic thinking skills. The factorial of a non-negative integer n is the product of all...

Prime Factorization with Python

This article explores several python programs for finding the prime factorization of an integer in Python. We will start with the least efficient implementation, and build up to more efficient versions. In...

Exploring Byte to GB Conversions Using Python

In the realm of computer science, converting bytes to gigabytes (GB) plays an important role, as it directly relates to the storage capacity of digital devices. However, this seemingly straightforward conversion is...

Exploring Shapes with Python: Sphere

A sphere is a fundamental geometric shape that often finds applications in mathematics, physics, computer graphics, and engineering. It’s defined as the set of all points in three-dimensional space equidistant from a...

Exploring Complex Numbers with Python

Complex numbers are an extension of the real numbers, consisting of a real and an imaginary part. They are useful in many mathematical and scientific applications, including electrical engineering, physics, and signal...

Calculating the Area and Perimeter of Shapes using Python

I’ve argued for a long time that Computer Science and Mathematics teaching could and should be much more integrated. For a long time, excellent mathematics educators have made use of graphics calculators...

Books for Learning Mathematics for Computing

From positioning items on the screen to dealing with complex simulations of the laws of physics in animated games, to finding ways to optimise information flow in a vast network, the fields...

Power Sets with Python

A power set is the set of all possible subsets of a set. For example, if we have a set containing [A, B, C] the possible subsets are: [[], ['A'], ['B'], ['A',...

Prime Numbers in Python

In this article we are going to look a some different ways to check whether a number is prime using Python. As well as being an interesting and useful exercise, this exploration...

PYTHON LOOP INVARIANTS

Writing robust code is always a good idea, but is particularly important for mission critical contexts, such as where safety is an issue. There are several historical examples of where faulty code...