#!/usr/bin/python import random import cgitb cgitb.enable() numbers = [] for x in range(0, 50): numbers.append(random.randrange(0, 1000)); print "Content-type: text/html\n\n" print "
I love numbers. Here's a few for you:
", numbers, "
The length of the list is ", len(numbers), ". The third element in the list is ", numbers[2], "
" largest = -1 for num in numbers: if (num > largest): largest = num print "The largest number is ", largest, ""