
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
Convert a list to string in Python program
In this article, we will learn about the solution to the problem statement given below.
Problem statement − We are given a list iterable, we need to convert it into a string type iterable.
There are four approaches to solve the given problem. Let’s see them one by one−
Brute-force Approach
Example
def listToString(s): # initialize an empty string str_ = "" # traverse in the string for ele in s: str_ += ele # return string return str_ # main s = ['Tutorials', 'Point'] print(listToString(s))
Output
TutorialsPoint
Using Built-In join() method
Example
def listToString(s): # initialize an empty string str_ = "" # return string return (str_.join(s)) # main s = ['Tutorials', 'Point'] print(listToString(s))
Output
Tutorialspoint
Using List Comprehension
Example
def listToString(s): # initialize an empty string str_=''.join([str(elem) for elem in s]) # return string return str_ # main s = ['Tutorials', 'Point'] print(listToString(s))
Output
Tutorialspoint
Using Built-In map() & join() method
Example
def listToString(s): # initialize an empty string str_=''.join(map(str, s)) # return string return str_ # main s = ['Tutorials', 'Point'] print(listToString(s))
Output
Tutorialspoint
Conclusion
In this article, we have learnt about python program to convert a list into a string .
- Related Articles
- Python program to convert a list to string
- Convert string enclosed list to list in Python
- Convert list of string to list of list in Python
- Python - Convert list of string to list of list
- How to convert list to string in Python?
- Convert a string representation of list into list in Python
- Java Program to Convert a List of String to Comma Separated String
- How to convert a string to a list of words in python?
- Program to convert List of Integer to List of String in Java
- Program to convert List of String to List of Integer in Java
- Convert list of numerical string to list of Integers in Python
- Java program to convert a list of characters into a string
- C# program to convert a list of characters into a string
- Python program to find the String in a List
- Python Program to Convert a given Singly Linked List to a Circular List

Advertisements