Hello, I think my problem is very simple but I cannot figure it out. I am trying to add the even indices of the list <digits> into the variable <even>. The error persists on the last line of the function <oddEvenSame>. I do not understand why you cannot iterate through the list with the for loop to add the indices?
def main(): # Get Input Number n = int(input("Enter a number:")) # Call <oddEvenSame()> oddEvenSame(n) def oddEvenSame(n): # Split all digits of <n> into their own index within <digits> digits = [int(i) for i in str(n)] # Add even indices of <digits> into <even> even = 0 for j in range(0, len(digits), 2): even += digits[j] # Call <main()> main()