Understand OOPs Concept in Python

  • It is easy to understand program using oops.
  • Oops focuses on writing usable code.
  • Data is always safe with data abstraction.
  • Class
  • Objects
  • Inheritance
  • Polymorphism
  • Encapsulation
  • Abstraction
  1. Class:
  • Classes are created by keyword class.
  • The variables that make up a class are called attributes.
  • Attributes can be accessed using the dot (.) operator. Eg.: Student.attribute
class ClassName:
< statement - 1 >
.
.
< statement - N >
class Student:
pass
obj = Student()
class baseClass:
class derivedClass(baseClass):
print(4+5)
output : 9
print('4' + '5')
output : 45"
print("walk" + "ing")
output : walking

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Divi 4: Theme Builder Hack for Fixed Headers

Temporary, On-Demand EC2 Instances

#PatronDoge #PatronDogeDAF #PATRON #Meme #Memes #NFT #PatronArt From my point of view, a very…

Find a Corresponding Node of a Binary Tree in a Clone of That Tree- Leetcode (Medium Level)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rai Mohit Samshersingh

Rai Mohit Samshersingh

More from Medium

Git Fundamentals — Branching (creating and merging)

“Hello C”

Polymorphism in Python

DataCamp Vs DataQuest