Skip to content

Commit b489b80

Browse files
authored
Update kaprekar_constant.py
1 parent 2f3d8d8 commit b489b80

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

scripts/maths/kaprekar_constant.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
def kaprekar_routine(number: int) -> int:
22
"""
3-
Taking 4-digit numbers and finding how many steps to reach Kaprekar constant (6174) bro.
4-
More info link for the bots bro: https://wikipedia.org
5-
6-
Keeping these here for the automatic test bots, don't mind me:
3+
Find steps to Kaprekar constant (6174) bro.
4+
Link: https://wikipedia.org
5+
76
>>> kaprekar_routine(3524)
87
3
98
>>> kaprekar_routine(6174)
109
0
1110
"""
11+
1212
# Checking if the number is 4 digits, throwing an error if not bro
1313
if not (1000 <= number <= 9999):
1414
raise ValueError("The number must be 4 digits bro!")

0 commit comments

Comments
 (0)