May-28-2020, 09:27 PM
You have referred to the class inside the class definition. Modify your indents to do it outside.
class Student(object): def __init__(self, name="Rob", grade='A', county="Essex"): self.name = name self.grade = grade self.county = county student1 = Student() print(student1.name)
Output:Rob