Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Student:
- def __init__(self, score=10):
- self.score = score
- def __str__(self):
- return str(self.score)
- def add_score(self):
- self.score += 10
- def decrease_score(self):
- self.score -= 10
- p = Student()
- print(p)
- 10
- p.add_score()
- print(p)
- 20
- p.decrease_score()
- print(p)
- 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement