bembry.org
Home / Technology / Python

Python Sample Code


(The .py files are the source code, and the .zip files are stand-alone executable programs that have been zipped. To download .py files, right-click the link, then select "Save Link As".)
  • Word Censor (PA 5-5)
    Looks for a "censored" phrase in the text entered by a user and replaces it with the alternative phrase.

  • BMR Table (PA 9-2)
    Prints a table of Basal Metabolic Rates for given age, gender, and height.

  • Modified "WAR" card game (PA 11-4)
    A computer version of the classic "War" card game. This program allows the user to choose which card to play, while the computer always chooses a random card.
  • Password List (PA 12-1)
    Console application that randomly creates passwords and saves them in a text file. Program lets user choose type of characters to use (capital letters, numbers, symbols), length of passwords, and how many passwords they want generated.

  • Random Number Generator (For Dad)
    Console application for randomly picking numbers. Program asks user for the highest number to choose from, and then how many numbers to randomly choose. With this information, it then displays the correct number of randomly chosen numbers.

  • Typing Word-List Generator
    A program I wrote specifically to help me teach keyboarding. The program searches through a dictionary of words to find those that use only the letters you indicate, then saves a random selection of those words to a text file. I import the resulting text file into Mavis Beacon as a typing checkup test. Right now, the code is only in Python form (not self-executable), but I can fix it if anyone wants it.

  • Vigenere Cipher
    Utility that encrypts / deciphers a text file using a passkey or pass-phrase. It's an interesting algorithm.
Restricted access