Skip to content

Commit

Permalink
Update two_decimal_places.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ikostan committed Oct 24, 2024
1 parent ec6e531 commit d93894d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kyu_7/formatting_decimal_places_1/two_decimal_places.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ 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 are used in the tests.
number because only valid numbers ae used in the tests.
Don't round the numbers! Just cut them after two decimal
places!
:param number:
:return: float
"""
number: str = str(number)
return float(number[0:number.index('.') + 3])
number_str: str = str(number)
return float(number[0: number_str.index('.') + 3])

0 comments on commit d93894d

Please sign in to comment.