Passing Parameters into a object in Python

Once objects are created from classes in Python, they can be made unique from other objects made from the same class by giving them different data.

This is done by giving the attributes unique data. For example, an attribute of a class could be 'name'. So we could give different objects made with that class, different names.

This is done by adding data to the class by putting this data in brackets next to the class name when it is called.

bob = human("Bob", "Male", "British")



Comments

Popular posts from this blog

CPU Fetch-Decode-Execute Cycle

OSI Network Model

Scheduling