Skip to content

teanus/Validator-Luhn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Credit Card Validator

This Python module provides a function to validate credit card numbers using the Luhn algorithm.

Installation

No installation is required. Simply copy the validator.py file into your project.

Usage

Import the validate function from the module and use it to check if a credit card number is valid.

Example

from validator import validatorLuhn

# Example credit card numbers
card_number1 = "4539 1488 0343 6467"  # Valid Visa card number
card_number2 = "8273 1232 7352 0569"  # Invalid card number

# Validate the card numbers
is_valid1 = validatorLuhn.validate(card_number1)
is_valid2 = validatorLuhn.validate(card_number2)

print(f"Card number {card_number1} is valid: {is_valid1}")
print(f"Card number {card_number2} is valid: {is_valid2}")

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages