is there any way that I could add the string of one function by calling from other function.
def sumOfDoubleEvenPlace(number):
sum += (getDigit(number)) # sum should be in this function
this is calling function.
def getDigit(number)-> int:
sum = 0
for i in range (len(number)-2, -1, -2):
digit = int(number[i])
digit = digit * 2
if (digit >= 10):
digit = (digit % 10) + 1
#sum += digit this is the result i want in the above function
return digit
this function returns digit, and i want to add all the digits from get digit function into sum function. I commented the line, sum. So i want this sum in the first function. thanks for looking