David B. Paradice, Ph.D.



Harbert Eminent Scholar in Business Analytics
Raymond J. Harbert College of Business
Auburn University


Python Programs and Examples

Click on the program name to download the Python code. You will need to remove the .txt extension to run the code. The .txt extension is necessary for the code to download. Whether the .txt extension is on the file or not, you can use a text editor to edit the file.

bottles-of-beer.py.txt: the drinking song (looping)

csv-to-xml.py.txt: reads a csv file, outputs the same data in an XML format

csvfileio.py.txt: read and write a CSV file

dictionary-lookup.py.txt: using a dictionary to look up a value

dictionary-loop.py.txt: looping through a dictionary (looping)

displaying-files.py.txt: program that displays the contents of files (looping)

factorial.py.txt: calculates the factorial of n (i.e., n!) [n! = n * (n-1) * (n-2) * ... * 1]

factorial-recursive.py.txt: calculates the factorial of n (n!) using recursion

fibonacci.py.txt: constructs a Fibonacci sequence (1, 1, 2, 3, 5, 8, 13, ...)

fibonacci-recursive.py.txt: constructs a Fibonacci sequence (1, 1, 2, 3, 5, 8, 13, ...) using recursion

for-loop.py.txt: a for loop example (looping)

get-weather-data.py.txt: scrapes weather data (web scraping)

guessing-game.py.txt: guess the number (looping)

hello.py.txt: the simplest python program

simple-stuff.py.txt: some simple operations, including input and output

string-match.py.txt: a simple string matching example.