Writing and reading text files

Writing and reading text files in Python is fairly straightforward. It's easiest to illustrate the process with an example. Here is some code that generates the 52 cards in a…

Continue Reading Writing and reading text files

Overloading comparison operators

[latexpage] Overloading the six comparison operators works in a similar way to the overloading of arithmetic operators. The operators and their associated methods are: Default behaviour Before we try overloading…

Continue Reading Overloading comparison operators

Encapsulation and private data

Programmers used to other object oriented languages such as C++, C# or Java will be familiar with the idea of┬áprivate data fields and methods within a class. These private fields…

Continue Reading Encapsulation and private data