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 7542041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:03:28+00:00 2026-05-30T08:03:28+00:00

I tried following instructions: >>> values [‘9′, ’31’, ’32’] >>> map(‘abc’.join, values) and got:

  • 0

I tried following instructions:

>>> values ['9', '31', '32']
>>> map('abc'.join, values)
and got:
['9', '3abc1', '3abc2']

but i expected:

['abc9', 'abc31', 'abc32']

why am i mistaken?

Just for the record i circumvented it with:

>>> map(lambda x: 'abc%s' % x, values)

But i’m still puzzled by the behaviour of the 1st map-construct!

Thanks for all the insightful answers. They are all correct and helpful, so i had to threw the dice to choose which to accept – i would have accepted any of them 😉

  • 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-05-30T08:03:30+00:00Added an answer on May 30, 2026 at 8:03 am

    This will call subsequently

    'abc'.join('9')
    

    which gives '9' since there is only one element in the given argument to join, then

    'abc'.join('31')
    

    since '31' is similar to ['3', '1'] the result is '3abc1' and so on.

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

Sidebar

Related Questions

I tried following the instructions , but there's no Resources Filters section on the
I tried to install node.js by following instructions here: https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows ) I got these
Tried following the instructions here: How to use Google app engine with my own
I tried following the answer to this question , but could not get xsd.exe
I tried following the README file in Ruby 1.9.1 but I can't compile it
I want all the lines with assert_equal and without amazon. I tried following but
I tried the following code in LINQPad and got the results given below: List<string>
I tried following the instructions here in order to create a static website on
I've tried many configurations, but I keep getting the following error upon opening eclipse:
I am following the instructions on the page- http://guides.macrumors.com/Installing_LaTeX_on_a_Mac I tried setting up tex

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.