I just figured out Project Euler problem #12. This the first one I've done in Python, so I'm putting my code out there to hopefully get some constructive criticism. If anyone is interested, would you mind looking over my solution and letting me know how I can improve on it, either through optimization or style?Thanks!from math import*def divisorCount(n):    nDivisors = 0    integerSqrt = int(sqrt(n))    if sqrt(n) == integerSqrt:        nDivisors += 1    for i in range(1, integerSqrt - 1):        if n % i == 0:            nDivisors += 2    return nDivisorsdef main():    divisors = 0    incrementTriangle = 1    triangleNumber = 1    while True:        divisors = divisorCount(triangleNumber)        if divisors < 500:            incrementTriangle += 1            triangleNumber = triangleNumber + incrementTriangle        elif divisors >= 500:            print The first triangle number w/ 500+ divisors is, triangleNumber            return 0main()
Python Code Review - Project Euler #12
python;project euler