Oops... There were some bugs in that last one. *Here's the correct version:
Code:#!/usr/bin/env python import math, sys try: * *number = long(sys.argv[1]) except ValueError: * *print "Must enter an integer!" * *sys.exit(1) print "Factors: " s = long(math.sqrt(number) + 1) f = 1 found = 0 while f != s: * *if number % f == 0: * * * *print f, number / f * * *found = found + 1 * *f = f + 1 *


Reply With Quote
And I bet 10$ that more people could understand my program than yours.

Bookmarks