Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Consider the following program:
- class NN:
- def __init__(self):
- self.n = 0
- def get(self):
- self.n += 1
- return str(self.n)
- def reset(self):
- self.n = 0
- class NS(NN):
- def get(self, s):
- return s + NN.get(self)
- The following statements are executed in sequential order.
- 1) What does this print?
- foo = NS()
- 2) What does this print?
- print foo.get('b')
- 3) What does this print?
- foo.reset()
- print foo.get('c')
Add Comment
Please, Sign In to add comment