Bite 71. Keep state in a class + make its instance callable

In this Bite you write a small class to keep track of the max score in a game. When called as a function it receives a new score and returns the max score.

So calling it like this:

record = RecordScore()
print(record(10))
print(record(9))
print(record(11))
print(record(7))

.. would give the following outputs (11 becomes the new max score):

10
10
11
11

To achieve this implement the __call__ dunder (special) method on the RecordScore class. Good luck!

Will you be Pythonista #41 to crack this Bite?
It takes an average of ~24 minutes to solve this Bite (submissions 5-240 min).
Pythonistas rate this Bite 4.67 on a 1-10 difficulty scale.
» Up for a challenge? 💪

Login and get coding
We use Python 3.7