PYTHON OBJECTED
ORIENTED PROGRAMMING
(OOP)
CODING CLUB 2/19/2021
FUNCTIONAL PROGRAMMING VS OOP
Functional Programming Object Oriented Programming
• Function output depends only on input • Python is an object-oriented programming
language. Others include Java, C++, C#,
• Involves variables and functions JavaScript, Swift
• Data is stored in variables • Involves classes, methods, and objects
• Ex. Some Python Built in Functions: • Data is stored in objects—an object’s attributes
• abs() • Ex. List methods:
• pow() • list.append()
• sum() • list.remove()
• Every other function we have created so far… • list.index()
BENEFITS OF OOP
• Uses objects and classes to represent things
• Allows modeling real world situations
• Abstraction, inheritance, polymorphism, encapsulation
• Widely used by programming