Python 3 Intermediate - School Catalogue Project

Hey! I’m part way through the ‘School Catalogue’ project in the Intermediate Python course, and I’m stuck. https://www.codecademy.com/courses/learn-intermediate-python-3/projects/python-school-catalogue
Unfortunately, there is no video-tutorial or solution provided, so hoping to get help from the community:

Here is my code so far (please note that I do have the indentations all correct, although it may not appear so in this forum):

class School():
def init(self, Name, Level, NumberOfStudents):
self.Name = Name
self.Level = Level
self.NumberOfStudents = NumberOfStudents

def getName(self):
return self.Name

def getLevel(self):
return self.Level

def getNumberOfStudents(self):
return self.NumberOfStudents

def setNumberOfStudents(self, NumberOfStudents):
self.NumberOfStudents = NumberOfStudents

def repr(School):
print(“A {self.Level} school named {self.Name} with {self.NumberOfStudents} students”

highview = School(“Highview”, “Primary”, 250)
print(highview)
print(highview.getName())
print(highview.getLevel())
highview.setNumberOfStudents(251)
print(highview.getNumberOfStudents())

***end of code ***

Here is the error I am getting:

File “script.py”, line 22
highview = School(“Highview”, “Primary”, 250)
^
SyntaxError: invalid syntax

Can anyone help me to resolve this SyntaxError?

Thanks! Brandon.

See How do I format code in my posts?

As far as your error goes, if you don’t see anything wrong with the syntax on the line referenced, check the line above. Frequently, something is missing at the end of the previous line.

2 Likes

That was it, thanks for your help!

2 Likes