David B. Paradice, Ph.D.



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


Python Programs, Examples, and Data Files

Python Workshop Files

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.

Click on the file name to download the data.

WS 1 Object and Data Types.pdf: WS 1 notes (WS1)

hello.py.txt: the simplest python program (WS1)

threeinputs.py.txt: program 2 (WS1)


WS 2 pdf: WS 2 notes (WS2)

WS 2 PowerPoint: WS 2 PowerPoint deck(WS2)

listpractice.py.txtList practice program (WS2)

dictpractice.py.txtDictionary practice program (WS2)

tdata.csv: 3 rows of csv data(WS2)

simpleinput.py.txtPractice program for tdata.csv(WS2)


WS 3 Branch Loop Statements.pdf: WS 3 notes (WS3)

WS 3 PowerPoint: WS 3 PowerPoint deck(WS2)

guessing-game.py.txt: Guess the number (WS3)

Gamedata.csv: Auburn MBB game scores (WS3)

auscore.py.txt: Program to calculate score averages (WS3)


WS 4 Functions.pdf: WS 4 notes (WS4)

auscoredef.py.txt: Program to calculate score averages with function (WS4)

auscoreset.py.txt: Program to calculate score averages with sets and a function (WS4)




Other files

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.

8-queens-elegant.py.txt: an elegant solution to the 8 queens problem

8-queens-iterative.py.txt: an iterative solution to the 8 queens problem

8-queens.py.txt: a solution to the 8 queens problem

bank-account-object.py.txt: an example of defining an object

binary-to-integer.py.txt: converts a binary number entered as 1's and 0' into an integer number

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

branch.py.txt: an example of branching

branchgood.py.txt: a slightly better example of branching

command-line-input-and-try.py.txt: demonstrates a way to read arguments from the command line

csvfileflip.py.txt: csv file i/o

csv-to-xml.py.txt: reads a CSV file, outputs the same data in an XML format (see XML-to-CSV.py below) -- NOT VERIFIED FOR PYTHON 3

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) -- NOT VERIFIED FOR PYTHON 3

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) -- NOT VERIFIED FOR PYTHON 3

greet-function.py.txt: a simple function example.

itertools-groupby.py.txt: an example of string manipulation using itertools group by. -- NOT VERIFIED FOR PYTHON 3

loopy.py.txt: an example of looping

oldsort.py.txt: an example of sorting that does not use a built-in function (old school)

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

raw-input.py.txt: a simple raw input code example.

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

time.py.txt: an example of working with built-in time functions

timestamp.py.txt: an example of creating a file name with an embedded timestamp

time-sample.py.txt: a simple lookup example.

xml-to-csv.py.txt: reads an XML file, outputs a CSV file (see csv-to-xml.py above). -- NOT VERIFIED FOR PYTHON 3