Skip to content

Commit 56dfb2a

Browse files
committed
Add stub of OOP
1 parent d517ad6 commit 56dfb2a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Diff for: 07_object-oriented.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Object-Oriented Programming
2+
3+
## This is not part of the 10/12 tutorial
4+
5+
> I may develop it further in the future, but for now it is not going to fit within the tutorial, and it is the most disposeable part. But please let me know if you do want help or anything with this topic.
6+
7+
## Object-oriented proramming
8+
9+
Object-oriented programming centers around the definition of **classes**, which hold **attributes** and **methods** in one cohesive **object.** On one hand, this is sort of "where it all comes together," but in reality, it is far less important than the preceding sections (shocking, I know). Classes make your code much cleaner, but you can get by without them for simple things, whereas you would have a hard time doing without any of the last sections.
10+
11+
So this is just going to scratch the surface.
12+
13+
## Defining a class
14+
15+
A **class** is sort of a template, or maybe a container. It gives details about the properties of objects of that class (recursive, but that's how classes are).
16+
17+
The "class"ic example is a polygon:
18+
19+
```python
20+
class Polygon:
21+
def __init__(self, num_sides):
22+
self.num_sides = num_sides
23+
```
24+
25+
## (TBC)

0 commit comments

Comments
 (0)