Blog Introductions

In this  blog contains tutorials about  HTML Tutorials, Python Tutorials, CSS Tutorials, How to, PHP Tutorials, Java Tutorials, C++ Tutorials, Tutorials,  Examples, Source code,Learning,
Tips and Software development  services. Python OOP and Python object orriented programing  | Python tutorials Bestitworriors

 Python object orriented programing

Python tutorials




Python OOP and Python object orriented programing  | Python tutorials Bestitworriors - OOP stand for object orriented programin.In object oriented programin we work with object.Object define as any things which have some properties and functions.For exemple A car is a object which have properties like color,weight,length etc and which have functions like drive and stop etc.


Some Key Points of Python OOP


  1. OOP stands for object orriented programing
  2. In object orriented programing we work on object
  3. Object which have some properties and functions
  4. We create class for working an object
  5. Class contain properties and methods
  6. Class properties and methods can private,public or protected



Code




class FirstClass:
x = 5

p1 = FirstClass()
print(p1.x)


class SecondClass:
def __init__(self, name, age):
self.name = name
self.age = age

p2 = SecondClass("Bestitworrior", 36)

print(p2.name)
print(p2.age)



class ThirdClass:
def __init__(self, name, age):
self.name = name
self.age = age

def classfunction(self):
print("Hello my name is " + self.name)

p3 = ThirdClass("Bestitworrior", 36)
p3.classfunction()
p3.age = 40
del p3.age
del p3




OutPut

5
Bestitworrior
36
Hello my name is Bestitworrior





I hope You really enjoyed this blog . I try my best to make every thing is easy and helpfull to provide to public .You will get more blog about the Programing project and code . Thanks for visiting my blog if you have any querry related to this you can comment here i will try my best to response you back about Python OOP and Python object orriented programing  | Python tutorials Bestitworriors