From 92b66045418ad647b6e68623786844edc1bd6f51 Mon Sep 17 00:00:00 2001 From: roobiselvaraj Date: Tue, 16 Jul 2024 22:00:12 +0530 Subject: [PATCH] Update sports.py I have updated training function --- sports.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sports.py b/sports.py index c099cc3..5fe2faf 100644 --- a/sports.py +++ b/sports.py @@ -1,3 +1,4 @@ + class Sports: print("Welcome to the national sports meet!") @@ -58,3 +59,9 @@ def training_or_play(self): else: print(f"{self.myplayer} has lost the game.") exit() + def train(self): + training_increase = 5 + self.speed += training_increase + if self.speed > 100: + self.speed = 100 + print(f"{self.myplayer} trained and increased speed! Current speed: {self.speed}")