Advertisement
biswasrohit20

c

Mar 21st, 2021
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. class Student:
  2. def __init__(self, name, id, subject):
  3. self.name = name
  4. self.id = id
  5. self.subject = subject
  6.  
  7. def __str__(self):
  8. return '{}\'s id is {} and has taken the following subjects {}'.format(self.name, self.id,self.subject)
  9.  
  10. s = Student('cat', 123,[('comp1100', 78), ('comp1500',87)])
  11.  
  12. print(str(s))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement