How do I let a list with multiple indexes turn into a list with only one index in Python

Asked

Viewed 107 times

1

How do I transform an element like this:

lista = [testando, este, aplicativo]

on a list like this:

 lista = [testando este aplicativo]

Someone knows how to do this, and if it is possible to do this with the Python language??

  • 1

    if it is a list of string you can use the method join() to concatenate into a single string

  • That’s just what I needed, thanks!

  • Place lists inside dictionaries.

1 answer

2


Complementing the solution of camillaBim:

lista = ["testando", "este", "aplicativo"]
texto = (' ').join(lista)
print(texto)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.