There was an error while loading. Please reload this page.
1 parent 2f3d8d8 commit b489b80Copy full SHA for b489b80
1 file changed
scripts/maths/kaprekar_constant.py
@@ -1,14 +1,14 @@
1
def kaprekar_routine(number: int) -> int:
2
"""
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:
+ Find steps to Kaprekar constant (6174) bro.
+ Link: https://wikipedia.org
+
7
>>> kaprekar_routine(3524)
8
9
>>> kaprekar_routine(6174)
10
0
11
12
# Checking if the number is 4 digits, throwing an error if not bro
13
if not (1000 <= number <= 9999):
14
raise ValueError("The number must be 4 digits bro!")
0 commit comments