Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Student:
- def __init__(self, name, id, subject):
- self.name = name
- self.id = id
- self.subject = subject
- def __str__(self):
- return '{}\'s id is {} and has taken the following subjects {}'.format(self.name, self.id,self.subject)
- s = Student('cat', 123,[('comp1100', 78), ('comp1500',87)])
- print(str(s))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement