This repository contains Python programs and scripts created for the Holberton School 0x08. Python - More Classes and Objects project. The project focuses on advanced topics related to object-oriented programming in Python, including:
- class methods
- static methods
- properties
- class attributes
- special methods.
- All Python files were created and tested on Ubuntu 20.04
- All scripts are written in Python 3.8.5
- All files are executable
- The code adhere to PEP 8 style guidelines (pycodestyle version 2.8.*)
Below is a list of files in this repository, along with a description of each:
| File | Description |
|---|---|
| 0-rectangle.py | Defines a Rectangle class with private attributes and properties. |
| 1-rectangle.py | Adds public methods to the Rectangle class for area and perimeter calculation. |
| 2-rectangle.py | Adds functionality to the Rectangle class for printing the rectangle with the '#' character. |
| 3-rectangle.py | Implements the str and repr special methods for the Rectangle class. |
| 4-rectangle.py | Adds a class attribute and instance counter to the Rectangle class. |
| 5-rectangle.py | Implements a class method to create a square and a static method to compare two rectangles. |
| 6-rectangle.py | Adds 'width' and 'height' attributes validation to the Rectangle class. |
| 7-rectangle.py | Refactors the Rectangle class to use getters and setters for 'width' and 'height'. |
| 8-rectangle.py | Adds an 'area' method to the Rectangle class. |
| 9-rectangle.py | Adds a 'perimeter' method to the Rectangle class. |
| 101-nqueens.py | The script provides a complete implementation of solving the N-queens puzzle for a given value of N. |
| 0-main.py | Main file to test the functionality of the Rectangle class. |
| 1-main.py | Main file to test the functionality of the Rectangle class with class attributes. |
| 2-main.py | Main file to test the functionality of the Rectangle class with class and static methods. |
| 3-main.py | Main file to test the validation of the 'width' and 'height' attributes in the Rectangle class. |
| 4-main.py | Main file to test the functionality of the Rectangle class with getters and setters. |
| 5-main.py | Main file to test the 'area' method of the Rectangle class. |
| 6-main.py | Main file to test the 'perimeter' method of the Rectangle class. |
| 7-main.py | Main file to test the functionality of the Square class. |
| 8-main.py | Main file to test the validation of the 'size' attribute in the Square class. |
| 9-main.py | Main file to test the functionality of the SinglyLinkedList class. |
| 101-nqueens.py | Program that solves the N queens problem. |
| pycache | Contains the compiled bytecode files that are specific to the version of Python being used |
To run the scripts, you can use the following command:
./<filename.py>Replace <filename.py> with the name of the script you want to execute.