Python Examples
14. Python Class and Object example.
class student:
name = ''
fees = ''
def display(self):
print(self.name)
print(self.fees)
Harsha=student()
Harsha.name='Harsha'
Harsha.fees=50000
Harsha.display()
Output :
Harsha
50000
class student: name = '' fees = '' def display(self): print(self.name) print(self.fees) Harsha=student() Harsha.name='Harsha' Harsha.fees=50000 Harsha.display()Output :
Harsha
50000
Father of Python Language