473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Concatenating/Appending the list of elements

440 256MB
Hi

Is it possible to Concatenate/Append list of elements into a single string as shown below ?

I/P:

list = ['ID','1','1','2']

O/P:

'ID112'

I dont want to travese the individual element by element in a list and concatenate the string to get the final string

-PSB
May 1 '07 #1
2 5094
psbasha
440 256MB
If not list,is it possible with strings to ge the output?.

-PSB
May 1 '07 #2
bvdet
2,851 Expert Mod 2GB
Hi

Is it possible to Concatenate/Append list of elements into a single string as shown below ?

I/P:

list = ['ID','1','1','2']

O/P:

'ID112'

I dont want to travese the individual element by element in a list and concatenate the string to get the final string

-PSB
Expand|Select|Wrap|Line Numbers
  1. >>> s = ['ID','1','1','2']
  2. >>> ''.join(s)
  3. 'ID112'
  4. >>> 
May 1 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: bucket79 | last post by:
Hi is there anyway appending to dictionary? list has this feature >>>a = >>>a.append(1) >>>print a but dictionary can't
4
by: Juan | last post by:
Does any one know if there are reported bugs when concatenating strings? When debugging each variable has the correct value but when I try to concatenate them some values are missing (I can´t see...
2
by: Shaurya Vardhan | last post by:
Hi, On Appending a child in XML Node, I am having error, "Run-time exception thrown : System.ArgumentException - The node to be inserted is from a different document context." How to resolve...
1
by: Ron Adam | last post by:
In my program I have a lot of statements that append elements, but sometimes I don't want to append the element so it requres an if statement to check it, and that requires assigning the returned...
11
by: Girish Sahani | last post by:
I wrote the following code to concatenate every 2 keys of a dictionary and their corresponding values. e.g if i have tiDict1 = tiDict1 = {'a':,'b':} i should get tiDict2={'ab':} and similarly for...
5
by: toton | last post by:
Hi, I want to append one vector after another. so like, vector<intv1; ///put some elements to v2. I have a second vector vector<intv2; ///it has some elements. Now I do v1.reserve(v1.size()...
10
by: Debajit Adhikary | last post by:
I have two lists: a = b = What I'd like to do is append all of the elements of b at the end of a, so that a looks like: a =
4
by: jtanz0 | last post by:
Hi, I am trying to convert infix notation to postfix notation, so far i have been quite successfull but in order to move on to the next part of the program (RPN calculator) i need to take all the...
1
by: csharpula csharp | last post by:
Hello, I would like to add a content of two following lists values to one mutual list of List<ClassC: List<ClassA+ List<ClassB//when classA and classB inherit from mutual classC How can I do...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.