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

Tell us what’s happening:

The assignment is:
Create a variable called card_translation and assign it a translation table to replace all - and `` characters with an empty string.

It’s pretty straightforward. I don’t know what I’m doing wrong. The variable is there, the function is there also…

Your code so far


# User Editable Region

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

    

# User Editable Region

Your browser information:

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

Challenge Information:

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

Hello plinio0rodrigo, welcome to the forum!

It looks like your main function declaration is gone?
These line were supposed to be in it’s body.
If you add it back, and both of these lines in it’s body you should be good.

Thanks! Silly detail, but that’s the thing about programming… the devil lies in the details

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.