Class .program not running

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.

I can’t see any error. I think something wrong in class construction .
Following is the error message
“C:\Users\Administrator\PycharmProjects\O O P Class & Objects\venv\Scripts\python.exe” “C:/Users/Administrator/PycharmProjects/O O P Class & Objects/main.py”
Traceback (most recent call last):
File “C:/Users/Administrator/PycharmProjects/O O P Class & Objects/main.py”, line 3, in
class Student:
File “C:/Users/Administrator/PycharmProjects/O O P Class & Objects/main.py”, line 20, in Student
st1=Student(1001," Mahi", 24)
NameError: name ‘Student’ is not defined

Process finished with exit code 1

Thank you. Followed your hints. Now it is working properly. Thank you once again

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.