<jupyter_start><jupyter_text>OOP is the creative freedome to make the tools you need.  In a language as complete as python, it gives you amazing powers if you are willing to think.  You use class to name your object followed by the init which allows you to call the instance of the object.  Class object attributes can go before the init that will be inherrited by all instances of the object.  The "self." format is easy and is simply substituted into the general function format learned earlier.  The attributes are the variables and the methods are the functions of the object.  There is even an init to allow you to create what the user sees whenever anyone tries to print your object called "dunder string method" using the same format as the init.<jupyter_code>mylist = [1,2,3]
class Dog():
    #class object attributes can go here before the init
    def __init__(self,breed, name, spots):
        #attributes are just like variables you assign
        self.breed = breed
        self.name = name
        self.spots = spots
        #methods actually do things with your object and attributes
    def bark(self):
        print('Woof My nane is {}'.format(self.name))
my_dog = Dog(breed = 'wiener', name = 'Caesar',spots = False)
my_dog.bark()
class Circle():
    #class object attribute
    pi = 3.14
    
    def __init__ (self, radius = 1):
        
        self.radius = radius
        #attributes can do stuff too
        self.area = radius * radius* Circle.pi
        
        #method
    def get_circumference(self):
        return self.radius * self.pi * 2
my_circle = Circle(30)
my_circle.area
import rlcompleter, readline  
readline.parse_and_bind('tab:complete') 

lst = [1,2,3]
lst.count(2)
class Account():
    
    def __init__(self, owner, balance):
        
        self.owner = owner
        self.balance = balance
        
    def deposit(self,debit):
        
        self.balance == debit + self.balance
        return "Deposit Accepted"
    
    def withdraw(self,credit):
        self.balance == self.balance - credit
        
        if self.balance - credit < 0:
            
            return "Funds unavailable"
        else:
            return "Withdrawl Accepted"
        
    def __str__(self):
        return f"Owner: {self.owner} \n Balance: {self.balance}"<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07530120481927711, 'fraction_numerical': 0.006454388984509466, 'mean_word_length': 2.604651162790698, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '357714', 'license': 'Unlicense', 'n_tokens_mistral': 655, 'n_tokens_neox': 636, 'n_words': 264, 'path': 'OOP.ipynb', 'repo_name': 'Luzyviento/Class_Notebook', 'size': '2324'}