fork download
  1. #!/usr/bin/python3
  2.  
  3. #Check if n is a palindrome number
  4. def ispalindrome(n):
  5.  
  6. #Create a list m of each digit of n
  7. m=[int(_) for _ in str(n)]
  8.  
  9. fst = m[:int(len(m)/2)] #First half of the list of digits
  10. snd = m[int(len(m)/2):] #Second half of ditto
  11.  
  12. #If number of digits is odd, snd has one more item than fst,
  13. #so we delete the first digit in snd
  14. if len(fst) != len(snd):
  15. del snd[0]
  16.  
  17. #Now we compare if fst is equal to the reverse of snd
  18. if fst == snd[::-1]:
  19. return n
  20.  
  21. a = 10000
  22. i = range(100,999)
  23. j = range(100,999)
  24. w=list(set([(x*y) for x in i for y in j]))
  25. z=list(set([ispalindrome(k) for k in w]))
  26. print(z)
  27.  
  28. #while a < 998001:
  29. # if ispalindrome(a) == True:
  30. # print(a)
  31. # a+=1
  32.  
Success #stdin #stdout 4.18s 6160KB
stdin
Standard input is empty
stdout
[405504, 348843, 182281, 235532, 561165, 65556, 20502, 88088, 79897, 444444, 770077, 57375, 12321, 94249, 653356, 301103, 63536, 77877, 888888, 536635, 510015, 69696, 24642, 92229, 47174, 366663, 80908, 61516, 84048, 249942, 575575, 602206, 90209, 45154, 36963, 59495, 106601, 432234, 28782, 96369, 51315, 262262, 65656, 404404, 474474, 43134, 57475, 471174, 80008, 71817, 853358, 391193, 407704, 41114, 184481, 24742, 616616, 92329, 393393, 84148, 39093, 420024, 98489, 67776, 329923, 45254, 303303, 59595, 14541, 159951, 82128, 37073, 133331, 416614, 51415, 88288, 747747, 57575, 198891, 26862, 577775, 225522, 551155, 604406, 63736, 86268, 108801, 434434, 55555, 33033, 618816, 61716, 657756, 98589, 53535, 121121, 67876, 231132, 174471, 409904, 14641, 82228, 239932, 565565, 65856, 214412, 296692, 80208, 26962, 801108, 606606, 49494, 72027, 252252, 631136, 41314, 131131, 487784, 135531, 69996, 514415, 840048, 92529, 70007, 696696, 16761, 749947, 84348, 723327, 76167, 67976, 22922, 201102, 506605, 82328, 436634, 96669, 51615, 266662, 592295, 828828, 43434, 289982, 149941, 528825, 49594, 63936, 737737, 55755, 78287, 33233, 92629, 215512, 84448, 397793, 98789, 424424, 580085, 68086, 59895, 37373, 227722, 588885, 489984, 137731, 111111, 29192, 270072, 698896, 66066, 57875, 21012, 320023, 80408, 555555, 18981, 41514, 438834, 78387, 33333, 412214, 140041, 47674, 25152, 242242, 98889, 53835, 477774, 31313, 123321, 68186, 59995, 660066, 515515, 96869, 60006, 51815, 74347, 88688, 543345, 21112, 399993, 35453, 426624, 27072, 49794, 86668, 55955, 92829, 70307, 25252, 39593, 345543, 53935, 76467, 31413, 178871, 68286, 531135, 23232, 82628, 414414, 74447, 29392, 88788, 62926, 43734, 649946, 570075, 623326, 80608, 49894, 188881, 127721, 101101, 86768, 232232, 64246, 461164, 162261, 47874, 219912, 545545, 99799, 39693, 375573, 428824, 99099, 807708, 90909, 45854, 258852, 82728, 37673, 611116, 15151, 74547, 29492, 793397, 97079, 88888, 43834, 21312, 35653, 729927, 650056, 58185, 780087, 27472, 441144, 154451, 86868, 50005, 41814, 507705, 19291, 371173, 33633, 363363, 56165, 47974, 244442, 25452, 246642, 220022, 17271, 31613, 99199, 54145, 45954, 508805, 68486, 23432, None, 689986, 60306, 15251, 29592, 52125, 142241, 66466, 21412, 80808, 324423, 377773, 13231, 72627, 27572, 64446, 639936, 560065, 589985, 56265, 11211, 469964, 117711, 443344, 171171, 39893, 299992, 62426, 678876, 652256, 99299, 68586, 156651, 23532, 209902, 535535, 82928, 37873, 15351, 66566, 44044, 35853, 222222, 601106, 95259, 105501, 64546, 855558, 87078, 42024, 666666, 459954, 70707, 25652, 48184, 549945, 470074, 523325, 62526, 85058, 76867, 40004, 68686, 23632, 37973, 210012, 74847, 29792, 819918, 52325, 119911, 445544, 66666, 824428, 89198, 44144, 35953, 58485, 13431, 654456, 672276, 81018, 302203, 27772, 276672, 484484, 19591, 87178, 78987, 56465, 367763, 693396, 70807, 25752, 505505, 62626, 576675, 579975, 85158, 550055, 603306, 68786, 60606, 354453, 74947, 29892, 642246, 52425, 66766, 21712, 612216, 89298, 525525, 72927, 27872, 485584, 408804, 73937, 64746, 87278, 42224, 564465, 212212, 56565, 79097, 48384, 421124, 62726, 129921, 512215, 277772, 99599, 656656, 630036, 77077, 68886, 46364, 60706, 15651, 372273, 29992, 369963, 290092, 52525, 343343, 75057, 66866, 30003, 21812, 44344, 58685, 180081, 27972, 95559, 50505, 804408, 272272, 48484, 62826, 122221, 85358, 40304, 906609, 99699, 357753, 23932, 46464, 330033, 187781, 161161, 619916, 52625, 21912, 89498, 44444, 802208, 238832, 279972, 95659, 50605, 168861, 488884, 87478, 462264, 110011, 79297, 34243, 292292, 93639, 71117, 26062, 17871, 40404, 554455, 202202, 297792, 384483, 15851, 38383, 52725, 89598, 44544, 447744, 476674, 67076, 22022, 359953, 280082, 333333, 28182, 189981, 65056, 56865, 20002, 216612, 71217, 26162, 425524, 40504, 809908, 99899, 63036, 255552, 308803, 91719, 46664, 138831, 464464, 83538, 61016, 294492, 30303, 89698, 321123, 402204, 67176, 58985, 204402, 73337, 28282, 42624, 234432, 65156, 79497, 34443, 221122, 648846, 93839, 452254, 99999, 18081, 282282, 46764, 335533, 661166, 147741, 69296, 83638, 165561, 491194, 61116, 52925, 89798, 44744, 374473, 67276, 401104, 81618, 513315, 59095, 257752, 636636, 73437, 509905, 20202, 519915, 440044, 79597, 93939, 48884, 675576, 40704, 32523, 55055, 46864, 83738, 38683, 571175, 273372, 44844, 128821, 81718, 36663, 102201, 73537, 28482, 595595, 861168, 663366, 51015, 42824, 256652, 493394, 34643, 141141, 48984, 520025, 26462, 40804, 63336, 18281, 77677, 32623, 259952, 585585, 46964, 69496, 24442, 306603, 83838, 468864, 213312, 284482, 442244, 16261, 821128, 30603, 98189, 143341, 44944, 22422, 90009, 59295, 886688, 14241, 534435, 155551, 522225, 87978, 42924, 20402, 79797, 34743, 57275, 12221, 573375, 26562, 94149, 54945, 456654, 77777, 55255, 10201, 286682, 69596, 92129, 548845, 98289, 53235, 378873, 90109, 81918, 36863]