From 443a58f164226b587cab11cfe471fc7d68971ec0 Mon Sep 17 00:00:00 2001 From: Egor Kostan Date: Thu, 24 Oct 2024 16:34:58 -0700 Subject: [PATCH] Update two_decimal_places.py --- kyu_7/formatting_decimal_places_1/two_decimal_places.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kyu_7/formatting_decimal_places_1/two_decimal_places.py b/kyu_7/formatting_decimal_places_1/two_decimal_places.py index 30f2b51480b..f01b102d8b1 100644 --- a/kyu_7/formatting_decimal_places_1/two_decimal_places.py +++ b/kyu_7/formatting_decimal_places_1/two_decimal_places.py @@ -11,7 +11,7 @@ def two_decimal_places(number) -> float: only the first two decimal places are returned. You don't need to check whether the input is a valid - number because only valid numbers ae used in the tests. + number because only valid numbers are used in the tests. Don't round the numbers! Just cut them after two decimal places! @@ -20,4 +20,4 @@ def two_decimal_places(number) -> float: :return: float """ number_str: str = str(number) - return float(number[0: number_str.index('.') + 3]) + return float(number_str[0:number_str.index('.') + 3])