These Javascript programs verify the 16-digit number on ATM and credit cards, and the 10- and 13-digit ISBN's on books. Enter the number (no spaces or dashes) and push the proper button.
View the source to see how they work.
Exercise: translate them into Python.
Another exercise: allow dashes and spaces.