The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 327 Weeks Ago, 5 Days Ago |
| Questions Answered: | 12843 |
| Tutorials Posted: | 12834 |
MBA, Ph.D in Management
Harvard university
Feb-1997 - Aug-2003
Professor
Strayer University
Jan-2007 - Present
Write a program in python to compute if a given number is a valid credit card number.
Credit card numbers have what is called a check digit. This is a simple way of detecting common mis-typings of card numbers. The algorithm is as follows:
An example run might be:
Type a credit card number (just digits):Â 1
1 is not a valid credit card number
Another run might be:
Type a credit card number (just digits):Â 240
Yes, 240 is a valid credit card number
Another run might be:
Type a credit card number (just digits):Â 9548
Yes, 9548 is a valid credit card number
Another run might be:
Type a credit card number (just digits):Â 5490123456789129
5490123456789129 is not a valid credit card number
-----------