List needs to be converted to a string and perform a string operations,
Is there a effective way to convert both the operations into 1,
lista = ['col-1,','col-2,','col-3,']
stra = ' '.join(lista)
stra = stra.rstrip(',')
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Since your
joinreturns a string.. So, instead of storing it, you can chain one more method call…Or, better you can do this: –
This will not print comma(,) in between your list items..