take a number as input say (n) and add all the digit of this numnber until result is not equal to a single digit no.
EX. 1245358,
output=1+2+4+5+3+5+8=28, 28=2+8=10, 10=1+0=1
so, output=1
n=int(input())
for i in range(n):
add=add+n[i]
if add>9:
while add<10:
for j in range(add):
add+=add[j]
print(add)
else:
print(add)
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(1 + 1, 2)