5
Good personal and possible to add comma in an example string:
a = '1234567890abcdefghijklmnopqrstuvwxyz_'
for her to stay like this a = 1,2,3,4,5,6,7....
5
Good personal and possible to add comma in an example string:
a = '1234567890abcdefghijklmnopqrstuvwxyz_'
for her to stay like this a = 1,2,3,4,5,6,7....
5
Do the following:
lst = list(a) // transforma sua string em lista
txt = ",".join(lst) // coloca vírgula entre as letras
Note that this can be done in just one step:
a = ",".join(a)
Browser other questions tagged python string python-2.7
You are not signed in. Login or sign up in order to post.
Thank you Eduardo for that.
– GlaucioFonseca
You’re welcome :) @Glauciofonseca
– EduardoFernandes
You can also be more direct right using: >>> a = "1234567890abcdefghijklmnopqrstuvwxyz_" >> a = ",". join(a)
>>> a
'1,2,3,4,5,6,7,8,9,0,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,_'
– GlaucioFonseca
Why not
a = ",".join("1234567890abcdefghijklmnopqrstuvwxyz_")
?... Relax, it’s just to relax.– StillBuggin
hahahahahahahahahahah... Ufa :)
– EduardoFernandes
hahahahaha and this :)
– GlaucioFonseca
Actually I use the python console a lot to keep doing these crazy my kkkkk
– GlaucioFonseca