Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Unable to convert list into string in python

How do i convert a list into a string in python?

I have tried using a for loop but i want a simpler method to join.

Input:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

['I', 'want', 4, 'apples', 'and', 18, 'bananas']

Output:

I want 4 apples and 18 bananas

>Solution :

you can try using .join() method to convert the list into the string.
First you declare your List and then declare a empty string variable then use
.join() method to convert.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading