Top-rated recipes tagged "card"http://code.activestate.com/recipes/tags/card/top/2012-12-07T01:49:19-08:00ActiveState Code RecipesCredit Card Validation (Python) 2011-08-11T19:06:58-07:00Stijn de Graafhttp://code.activestate.com/recipes/users/4178055/http://code.activestate.com/recipes/577838-credit-card-validation/ <p style="color: grey"> Python recipe 577838 by <a href="/recipes/users/4178055/">Stijn de Graaf</a> (<a href="/recipes/tags/card/">card</a>, <a href="/recipes/tags/credit/">credit</a>, <a href="/recipes/tags/false/">false</a>, <a href="/recipes/tags/number/">number</a>, <a href="/recipes/tags/testing/">testing</a>, <a href="/recipes/tags/true/">true</a>, <a href="/recipes/tags/validating/">validating</a>, <a href="/recipes/tags/validation/">validation</a>). </p> <p>Test validity of any credit card number using the LUHN method (mod 10). Starting at the last digit and moving backwards, you add up every other digit. Then, you double the left-out digits, and add the digits of these results to the original sum. If this satisfies sum mod 10 == 0 then the card is valid.</p> <p>This is also explained at <a href="http://www.beachnet.com/%7Ehstiles/cardtype.html" rel="nofollow">http://www.beachnet.com/~hstiles/cardtype.html</a></p> Determine credit card type by number (Python) 2011-08-01T13:41:09-07:00Paul Saparovhttp://code.activestate.com/recipes/users/4178836/http://code.activestate.com/recipes/577815-determine-credit-card-type-by-number/ <p style="color: grey"> Python recipe 577815 by <a href="/recipes/users/4178836/">Paul Saparov</a> (<a href="/recipes/tags/card/">card</a>, <a href="/recipes/tags/credit/">credit</a>). </p> <p>Simple function that determines cc type by number</p> War Game (Version 6) (Python) 2012-12-07T01:49:19-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578370-war-game-version-6/ <p style="color: grey"> Python recipe 578370 by <a href="/recipes/users/2608421/">Stephen Chappell</a> (<a href="/recipes/tags/card/">card</a>, <a href="/recipes/tags/demonstration/">demonstration</a>, <a href="/recipes/tags/game/">game</a>). </p> <p>As the final version of the War Game, development finally came to a halt as the prototype exceeded it bounds for design. Yes, you can write your program as one large function, but should you? This recipe demonstrates that program without proper style can lead to a mess very quickly. Practice good coding standards, or you can easily loose focus and the ability to maintain your code.</p> War Game (Version 5) (Python) 2012-12-07T01:40:06-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578369-war-game-version-5/ <p style="color: grey"> Python recipe 578369 by <a href="/recipes/users/2608421/">Stephen Chappell</a> (<a href="/recipes/tags/card/">card</a>, <a href="/recipes/tags/demonstration/">demonstration</a>, <a href="/recipes/tags/game/">game</a>). </p> <p>Part of the War Game set, this version of War Game further advanced the program in an environment without curses. Showing another iteration of development, the recipe here program for more fun with a virtual card game and ASCII graphic card representations while playing.</p> Password Card Generator (Python) 2012-01-26T02:37:30-08:00userendhttp://code.activestate.com/recipes/users/4179007/http://code.activestate.com/recipes/578027-password-card-generator/ <p style="color: grey"> Python recipe 578027 by <a href="/recipes/users/4179007/">userend</a> (<a href="/recipes/tags/card/">card</a>, <a href="/recipes/tags/create/">create</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/passwd/">passwd</a>, <a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/secret/">secret</a>). </p> <p>This project was inspired by the <a href="http://passwordcard.org" rel="nofollow">passwordcard.org</a> website. I wanted to see if I could do the same thing using Python. Select a password using this convenient card that you carry with you. </p>