student() takes no arguments error. I tried to check everything can anyone please help me in solving it

Question:

enter image description here

class Student:
  def __init__(self,name,age,grade):
    self.name = name
    self.age = age
    self.grade = grade # 0 - 100

  def get_grade(self):
    return self.grade
class Course:
  def __init__(self,name,max_students):
    self.name = name
    self.max_students = max_students
    self.students = []

  def add_student(self,student):
    if len(self.students)<self.max_students:
      self.students.append(student)
      return True
    return False

  def get_average_grade(self):
    pass

I am getting error as follows, I have added two underscore also don’t knwo where I am getting this wrong

Asked By: Ankit Kumar

||

Answers:

It looks like you’re using the wrong case. You want Student, not student.

Answered By: mmiron

you are using a lower-case s when creating the instance

Answered By: Sumit Kumar

Resolved this error, the error was associated to case sensitivity. Student call should use Student(argument_1,argument_2) used student.

Answered By: Ankit Kumar
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.