A simple python program to generate the checksum of credit cards using the 6 digits BIN(Bank Identification Number) and 9 digits PAN(Primary Account Number). This program uses Luhn Algorithm.

This program checks if user input is a positive integer or not. If not it simply keeps asking for input again until the user doesn’t enter the positive integer value.

We need to check for the scanf function return value. The scanf returns 1 if the input is integer and 0 if its character.

Sahil Rohilla

Hey, I’m a web developer & independent security researcher based in Russia. I like to read & write about technology and business.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store