Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8118387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:28:26+00:00 2026-06-06T04:28:26+00:00

it an answer for Euler project #4. A palindromic number reads the same both

  • 0

it an answer for Euler project #4.

A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.

Find the largest palindrome made from the product of two 3-digit numbers.

Answer:

906609

code is:

from multiprocessing import Pool
from itertools import product

def sym(lst):
    rst=[]
    for x,y in lst:
        tmp=x*y
        if rec(tmp):
            rst.append(tmp)
    return rst

def rec(num):
    num=str(num)
    if num == "".join(reversed(num)):    return True
    else:    return False

if __name__ == "__main__":
    pool=Pool(processes=8)
    lst=product(xrange(100,1000),repeat=2)
    rst=pool.map(sym,lst)
    #rst=sym(lst)
    print max(rst)

when I run this:

#    TypeError:'int' object is not iterable

but I can’t understand it…isn’t list iterable? or is there an error in my code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T04:28:27+00:00Added an answer on June 6, 2026 at 4:28 am

    Your problem is with the function sym.

    sym is being passed the first element of your product iterable. (e.g. lst = (100,100)). When you get to the for loop, you’re iterating over lst and then trying to unpack it into two numbers — equivalent to:

    for x,y in (100,100):
        ...
    

    Which fails for obvious reasons.

    I think you probably want to get rid of the for loop all-together — which was probably an artifact of your serial version.

    def sym(lst):
        x,y=lst
        tmp=x*y
        if rec(tmp):
            return tmp
        else:
            return None  #max will ignore None values since None > x is always False.
    

    The traceback was somewhat cryptic — Apparently the traceback gets returned to the Pool which then gets re-raised … But the way it is done makes it a little difficult to track.

    Sometimes, when debugging these things it is helpful to replace Pool.map() with the regular version of map. Then, any exceptions which get raised are raised on your main “thread” and the tracebacks can be a little easier to follow.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So on Project Euler the Problem 4 states the following: A palindromic number reads
Project Euler problem 36 states: The decimal number, 585 = 1001001001 (binary), is palindromic
I'm rewriting my answer(s) to Project Euler questions in MIPS assembly, and I can't
I am trying to solve Euler's Project #2 and I keep getting the answer
As stated in problem 37 at Project Euler : The number 3797 has an
I am trying to solve Q10 from Project Euler. I am using JavaScript and
I wrote an answer to the first Project Euler question: Add all the natural
I'm working on Project Euler problem number 205 which states: Peter has nine four-sided
I started doing Project Euler and got to problem number 9 . Since I
Here is how Project Euler Problem #76 sounds like: How many different ways can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.