Sections
Timeline
Sub-Sections
Download
Unified Diff
Zip Archive
Metanav
Preferences
About Trac
Links
Slowchop Studios
Gerald Kaszuba
Advertisement

Changeset 6

Show
Ignore:
Timestamp:
30/07/07 03:30:00 (18 months ago)
Author:
gak
Message:

moar

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • projecteuler/4.py

    r5 r6  
    1212            return False 
    1313 
    14 for a in xrange(999, 0, -1): 
    15     for b in xrange(999, 0, -1): 
     14biggest = 0 
     15bigfactors = None 
     16 
     17for a in xrange(999, 100, -1): 
     18    for b in xrange(999, 100, -1): 
    1619        if a < b: 
    1720            continue 
    18         if is_palindrome(a * b): 
    19             print a, b, a * b 
    20             sys.exit(0) 
     21        product = a * b 
     22        if is_palindrome(product): 
     23            if product > biggest: 
     24                biggest = product 
     25                bigfactors = [a, b] 
     26                print a, b, product 
    2127 
    2228