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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:17:53+00:00 2026-05-14T04:17:53+00:00

How do I convert a list of int s to a single string, such

  • 0

How do I convert a list of ints to a single string, such that:

[1, 2, 3, 4] becomes '1234'
[10, 11, 12, 13] becomes '10111213'

… etc…

  • 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-14T04:17:53+00:00Added an answer on May 14, 2026 at 4:17 am
    ''.join(map(str, [1,2,3,4] ))
    
    • map(str, array) is equivalent to [str(x) for x in array], so map(str, [1,2,3,4]) returns ['1', '2', '3', '4'].
    • s.join(a) concatenates all items in the sequence a by the string s, for example,

      >>> ','.join(['foo', 'bar', '', 'baz'])
      'foo,bar,,baz'
      

      Note that .join can only join string sequences. It won’t call str automatically.

      >>> ''.join([1,2,3,4])
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      TypeError: sequence item 0: expected string, int found
      

      Therefore we need to first map all items into strings first.

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

Sidebar

Related Questions

I need an easy way to convert a List<int> to a string array. I
I have two list that I convert them to a single two dimesnional array
I have functon that convert list in array: void* list_to_array(SList* list) { int i;
What is the easiest way to convert list with str into list with int
How do I convert int[] into List<Integer> in Java? Of course, I'm interested in
How do I convert a list of String into an array ? The following
I need to convert a list of numbers that fall within certain ranges into
struct WeatherStation { string Name; double Temperature; }; void Initialize(WeatherStation[]); void HL(WeatherStation List[]); int
How can I convert a List<Integer> to int[] in Java? I'm confused because List.toArray()
Is it possible to convert two or more lists into one single list, in

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.