Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Just a code example
class Student:
def __init__(self, name, student_id=332):
self.name = name
self.student_id = student_id
def __str__(self):
return "Student: " + self.name
def get_name_capitalized(self):
return self.name.capitalize()
students = []
student = Student("Ryan Collins", 777)
students.append(student)
print(students[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment