Part 2: Simulating a Tennis Match Using Object-Oriented Programming in Python—Wimbledon Special

How does the likelihood of winning a tennis match change as the likelihood of winning a single point changes? How about the probability of a best-of-five match ending in three sets? Let's have some fun exploring some of these questions using a Python tennis match simulation program. I won't try to factor in all the… Continue reading Part 2: Simulating a Tennis Match Using Object-Oriented Programming in Python—Wimbledon Special

Simulating a Tennis Match Using Object-Oriented Programming in Python—Wimbledon Special Part 1

Simulating a tennis match using object-oriented programming in Python

With Wimbledon underway, I thought of paying homage to the classic tennis tournament with a program simulating a tennis match in Python. I'll use this program to explore several key concepts in Object-Oriented Programming. You'll write a program which will allow you to do two things: Part 1: You can keep the score of a… Continue reading Simulating a Tennis Match Using Object-Oriented Programming in Python—Wimbledon Special Part 1

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)

Simulating Orbiting Planets in a Solar System Using Python (Orbiting Planets Series #1)

Orbiting Planets in Solar System

One of the many applications of programming in Python is simulating the real world. In some cases, the simulation is a way of solving a problem that would be difficult or impossible to solve using other means. In this article, you'll explore simulating orbiting planets in a solar system using Python. You'll create code that… Continue reading Simulating Orbiting Planets in a Solar System Using Python (Orbiting Planets Series #1)

Python Instance Variables and Kids on A School Trip

Python instance variables and kids on a school trip

How are Python instance variables different from standard variables? Are they the same thing as data attributes? And what are data attributes? And what do kids on a school trip have got to do with all of this? Questions, questions and more questions. Understanding instance variables in Python tends to happen in stages. First, you… Continue reading Python Instance Variables and Kids on A School Trip