Skip to content

A simple Python implementation of the Luhn Algorithm for validating credit card numbers, completed as part of a FreeCodeCamp project.

Notifications You must be signed in to change notification settings

ITZ-BURHAN-KHAN/Luhn-Algorithm-Credit-Card-Validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Luhn Algorithm Credit Card Validator

A simple Python implementation of the Luhn Algorithm for validating credit card numbers, completed as part of a FreeCodeCamp project.

The Luhn Algorithm is widely used for error-checking in various applications, such as verifying credit card numbers. This project implements the Luhn Algorithm in Python, allowing users to validate credit card numbers easily.

Project Overview

By building this project, you'll gain experience working with numerical computations and string manipulation. The program reads a credit card number, processes it according to the Luhn Algorithm, and determines whether it is valid or invalid.

Features

  • Validates credit card numbers using the Luhn Algorithm
  • Handles card numbers formatted with spaces or dashes
  • Simple and easy-to-understand implementation

How to Use

  1. Clone this repository to your local machine.
  2. Run the main() function to test the credit card validation with the provided card number.
  3. Modify the card_number variable in the main() function to test other credit card numbers.

Example Usage

def main():
    card_number = '4111-1111-4555-1142'  # Example valid card number
    # Your code here

Requirements

  • Python 3.x

Acknowledgments

This project was completed as part of a FreeCodeCamp tutorial. Thank you to FreeCodeCamp for providing valuable learning resources!

About

A simple Python implementation of the Luhn Algorithm for validating credit card numbers, completed as part of a FreeCodeCamp project.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages