Skip to content

Commit ef74077

Browse files
committed
fixed a comment
1 parent f48fa0e commit ef74077

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

source/ch6_definingclasses.ptx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,10 +839,10 @@ class Student:
839839
def __init__(self, id, name):
840840
self.id = id
841841
self.name = name
842-
Student.numStudents = Student.numStudents + 1 # increment the static variable
842+
Student.numStudents = Student.numStudents + 1 # this is a static variable, that can be accessed without the self prefix
843843
def main():
844844
for i in range(10):
845-
s = Student(i,"Student-"+str(i)) // create a new student
845+
s = Student(i,"Student-"+str(i)) # create a new Student object
846846
print('Number of students:', Student.numStudents)
847847
main()
848848
</code> <tests> </tests>

0 commit comments

Comments
 (0)