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

Tell us what’s happening:

I have tried several things, but nothing seems to work.

Opt 1:
#this I’ve seen in the current comments. Someone asked the same thing

def main(verify_card_number(translated_card_number)):

Opt 2:
#tried PASSING it as an argument inside of the main function

def main(verify_card_number, translated_card_number):

Opt 3:
#tried to pass is in the body of the function. Indent.

def main(verify_card_number):
** translated_card_number**

I’m close, but I can’t seem to find the solution. Any advice?

Your code so far

def verify_card_number(card_number):
    pass


# User Editable Region

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

    print(translated_card_number)


# User Editable Region

main()

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Challenge Information:

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

I figured it out. Not in the () of the main, but as a ‘return’ after the print.
The confusion was in in the wording of the question: within the main function…
This wording let me to assume I was supposed to use the () after main

1 Like

Hi and welcome to the forum! :wave:

Glad you were able to solve it on your own! This shows grit and tenacity which is invaluable.

To be clear on the terminology:

#first line is the function definition:
def function(this area is where function parameters are defined):
    this is the function code

function(arguments go here)  #this is a function call