Write a program to create class and object in Python?

All QuestionsCategory: PythonWrite a program to create class and object in Python?
Chetan Shidling asked 4 years ago

I need short information.

1 Answers
Chetan Shidling answered 4 years ago

Creating class and object in Python.
 
class A
      def chetan1(self):
             print(“Chetan 1 working”)
      def chetan2(self):
              print(“Chetan 2 working”)
 
a1 = A()
 
a1.chetan1()
a1.chetan2()
 
Output:
Chetan 1 working
Chetan 2 working