Aprenda Como Trabajar con Números y Cadenas Implementando el Algoritmo Luhn - Paso 19

Cuéntanos qué está pasando:

Could someone guide me, I tried print(odd_digits) and it doesn’t solve

Tu código hasta el momento


# User Editable Region

def verify_card_number(card_number):
    sum_of_odd_digits = 0
    card_number_reversed = card_number[::-1]
    odd_digits = card_number_reversed[::2]
    
    for char in odd_digits():
        print(char)


# User Editable Region

def main():
    card_number = '4111-1111-4555-1142'
    card_translation = str.maketrans({'-': '', ' ': ''})
    translated_card_number = card_number.translate(card_translation)

    verify_card_number(translated_card_number)

main()

Información de tu navegador:

El agente de usuario es: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36

Información del Desafío:

Aprenda Como Trabajar con Números y Cadenas Implementando el Algoritmo Luhn - Paso 19

odd_digits is a variable, not a function.

print() is a function so it has parentheses.

If you are taking one element from odd_digits it would make sense to call that variable the singular form “digit” or “odd_digit”. “char” or “character” doesn’t really make sense since it’s a number not a letter.