# Learn How to Work with Numbers and Strings by Implementing the Luhn Algorithm - Step 24

### Can anyone help me. I do not know where I went wrong.

``````def verify_card_number(card_number):
sum_of_odd_digits = 0
card_number_reversed = card_number[::-1]
odd_digits = card_number_reversed[::2]

# User Editable Region

for digit in odd_digits:
sum_of_odd_digits += int(digit)
print(digit)

sum_of_even_digits = 0
even_digits = card_number_reversed[1::2]

for digit in even_digits:
sum_of_even_digits = int(digit)
print(digit)

# 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()
``````

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0`

### Challenge Information:

Learn How to Work with Numbers and Strings by Implementing the Luhn Algorithm - Step 24

1 Like

Loop over the even digits and print each to the console.

So thereâ€™s two things to do

1. Loop
2. Print

If you are doing anything other than that, I would remove that line of code.

you need to add your digit to `sum_of_even_digits`, if you overwrite the value of that variable at each loop iteration you are not summing anymore

I am sorry but I need your helpâ€¦I think my code is running but I got a message saying (You should have print(digit) within the fro loopâ€¦

@antoniobray If you have an issue with your code, itâ€™s usually best to create your own topic for it, as otherwise it can cause confusion.

However, in this case, the remedy is simple. Youâ€™re just getting a little ahead of yourself. You werenâ€™t yet asked to create a `sum_of_even_digits` variable, so just remove that line of code for now.

Sorry I am new hereâ€¦I did not know that I need to create my own topic if the topic exist already. Next time I will do itâ€¦
Thanks

1 Like

waoo it worksâ€¦but with python I got some problem with the indentetionâ€¦for example I did know that I can leave a blank line between my loop and the printâ€¦it was easyâ€¦at least I learn somthing new â€¦Thanks
â€“ removedâ€“

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original posterâ€™s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.