I have no idea why this gives me an error regarding this task.
Create a variable named card_number_reversed and assign it the value of the first 4 characters of card_number.
Your code so far
# User Editable Region
def verify_card_number():
sum_of_odd_digits = 0
card_number_reserved = card_number[0:4]
# User Editable Region
def main():
card_number = '4111-1111-4555-1142'
card_translation = str.maketrans({'-': '', ' ': ''})
translated_card_number = card_number.translate(card_translation)
print(translated_card_number)
verify_card_number(translated_card_number)
main()
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5 Safari/605.1.15
Challenge Information:
Learn How to Work with Numbers and Strings by Implementing the Luhn Algorithm - Step 10
The task is Create a variable named card_number_reversed and assign it the value of the first 4 characters of card_number.
My latest attempt code is below and the error message is “TypeError: verify_card_number() takes 0 positional arguments but 1 was given”. I don’t know what I am doing wrong… If someone can help me, that would be really helpful.
It is great that you solved the challenge, but please don’t post your full working solution.
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.