From d412a6e612aaf4a2012558e50eb999fb0b4b6db6 Mon Sep 17 00:00:00 2001 From: mankala sharathchandra <152910893+sharath4444@users.noreply.github.com> Date: Sat, 19 Oct 2024 15:32:01 +0530 Subject: [PATCH] Update recursive_digit_sum.py --- recursions/recursive_digit_sum.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recursions/recursive_digit_sum.py b/recursions/recursive_digit_sum.py index 86d19da0b..8edea2b32 100644 --- a/recursions/recursive_digit_sum.py +++ b/recursions/recursive_digit_sum.py @@ -17,7 +17,8 @@ from __future__ import annotations def super_digit(n_str: str, repetitions: int) -> int: """ - Computes the super digit of a number formed by concatenating n_str repetitions times. + Computes the super digit of a number formed by concatenating + n_str repetitions times. Parameters: n_str (str): The string representation of the integer. @@ -34,6 +35,7 @@ def super_digit(n_str: str, repetitions: int) -> int: 9 """ + # Calculate the initial sum of the digits in n_str digit_sum = sum(int(digit) for digit in n_str)