How to work with string, implementing the luhn algorithm – Python


Blockquote
hello there, I need help pls with this stage I’m currently stuck on- step 33 , implementing the Luhn algorithm

the prompt: Adjust the verify_card_number call such that if it returns True , print 'VALID!' to the console. Otherwise, print 'INVALID!' .

my code: verify_card_number(translated_card_number)
if (total % 10 == 0):
print(‘VALID!’)
else:
print(‘INVALID!’)

Here’s the link: https://www.freecodecamp.org/learn/scientific-computing-with-python/learn-how-to-work-with-numbers-and-strings-by-implementing-the-luhn-algorithm/step-33

l

Hi @Jaytriggers
Here are the instructions for this step:
image

You need to make the verify_card_number into an if statement.

Happy coding



Source link

Leave a Comment