mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-21 16:52:05 +00:00
Update recursive_digit_sum.py
This commit is contained in:
parent
fc8f143dd1
commit
d412a6e612
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user