I am adviser to a high school robotics team and wrote a small Python script to solve a pairing problem. We are starting our spring fund raising drive and I needed to randomly pair one student with one business. On my lunch break I hacked out the following script that solved the problem.
#import shuffle from random from random import shuffle with open("names", "r") as ins: names = for line in ins: names.append(line.rstrip('\n')) # shuffle names shuffle(names) ins.close() with open("businesses", "r") as ins: business = for line in ins: business.append(line.rstrip('\n')) ins.close() #shuffle businesses shuffle(business) c =  c = [names[ix]+ " - " + business[ix] for ix in range (len(names))] # print each pair on one line for elem in c: print elem
The business file included a list of business with one on each line. the names file included student names with one on each line. The program simply imports each line, stripping the new line code, in to an array. Each array is randomized and then the program concatenates the two arrays before printing out the assignment pairs to the screen. I always enjoy demonstrating command line Linux to students.