This is a sample O O P project.(NOT WORKING PROPERLY)
class Student: #Common base class for all students.
studentcount = 0 #class variable.
def __init__(self, rollno, name, age): #class constructor.
self.rollno=rollno
self.name=name
self.age=age
Student.studentcount = +1
def displayCount(self):
print("Total students:",Student.studentcount)
def displayStudent(self):
print("Rollno :", self.rollno)
print("Name:", self.name)
print("Age:", self.age)
st1=Student(1001," Mahi", 24)
st2=Student(1002,"Mohan", 25)
st3=Student(1003,"Madan",22)
st1.displayStudent( )
st2.displauStudent()
st3.displayStudent()
print("Total number of students:", Student.studentcount )
can anyone point out the error.