Can anyone tell me what's wrong with my class code? When I executed it, the program just pop up "Indentation Error: unindent does not match any outer indentation level"
The following is my code:
class Student:
totalStudents = 0
def __init__(self, name, year):
self.name = name
self.year = 0
self.grade = []
self.attend = 0
print("Add {0} to the classroom".format(self.name) )
Student.totalStudents += 1
def addGrade(self, grade):
self.grade.append(grade)
def attendDay(self):
self.attend += 1
def classAverage(self, grade):
return sum(self.grade) / len(self.grade)
def __str__(self, name, grade):
return "{0} is a {1} grader studnet".format(self.name, self.year)