RE: What is a Class? How do you create it in Python?

What is a Class? How do you create it in Python?

B Mathur Team Leader Asked on March 21, 2017 in PYTHON.
Add Comment
2 Answers

Python is an Object Oriented language and provide all the standard features of Object Oriented Programming.

Example of Class


class studentInfo:

def displayData(self, name ):

print "your name is: ", name

fn1 = studentInfo()

fn2 = studentInfo()

fn1.displayData("Aviance")

fn2.displayData("Ambar")

Output of the program:


your name is: Aviance

your name is: Ambar

IT Head Answered on December 5, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.