Tennis¶
🎯 Write a class `TennisGame` that determines the score of a round of tennis.
Use the following structure:
class TennisGame:
def __init__(self):
self.score = {
'player1': 0,
'player2': 0,
}
def point(self, player: str) -> None:
"""called with 'player1' or 'player2' to record points"""
self.scores[player] += 1
def get_score(self) -> str:
"""calculates the score"""
...
Translated with www.DeepL.com