Skip to content

Latest commit

 

History

History

0x06-python-classes

Python - Classes and Objects

Technologies

  • Files written in vi, vim, and emacs editors.
  • Files wriiten according to the betty coding style. Checked using betty-style.pl and betty-doc.pl.
  • Files tested on Ubuntu 20.04 LTS using gcc.
  • Python3.4 files

Files

Files Question
0-square.py My first square: Write an empty class Square that defines a square:
1-square.py Square with size: Write a class Square that defines a square by size (based on 0-square.py). Private instance attribute: size. Instantiation with size (no type/value verification).
2-square.py Size validation: Write a class Square that defines a square by size (based on 1-square.py). Instantiation with optional size: def __init__(self, size=0):.
3-square.py Area of a square: Write a class Square that defines a square by size: (based on 2-square.py). Public instance method: def area(self): that returns the current square area.
4-square.py Access and update private attribute: Write a class Square that defines a square by size: (based on 3-square.py). Instantiation with optional size: def __init__(self, size=0):. Public instance method: def area(self): that returns the current square area.
5-square.py Printing a square: Write a class Square that defines a square by size: (based on 4-square.py).
6-square.py Coordinates of a square: Write a class Square that defines a square by size: (based on 5-square.py).
100-singly_linked_list.py Singly linked list: Write a class Node that defines a node of a singly linked list.
101-square.py Print Square instance: Write a class Square that defines a square by size: (based on 6-square.py).
102-square.py Compare 2 squares: Write a class Square that defines a square by size: (based on 4-square.py).
103-magic_class.py Write the Python class MagicClass that implents Pythone bytcodes