---
title: "2 Ways Converting List to String in Python"
description: "Converting list to a string in Python is not hard. Here are two ways that you can use are for loop and join methods"
url: https://srinimf.com/2023/11/13/how-to-build-string-from-list-in-python/
date: 2023-11-13
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2022/02/python-covert-list-to-string.jpg?fit=2240%2C1260&ssl=1
categories: ["Python"]
tags: ["List to String Python"]
type: post
lang: en
---

# 2 Ways Converting List to String in Python

Here are two [ways to convert](https://srinimf.com/2024/05/31/5-nice-ways-to-convert-string-to-matrix-python/) a list to a string in Python using a for-loop and the join method. So, the examples describe converting to a string with and without join, with comma, with space.

Table of contents

1. [Converting List to a String](https://srinimf.com/2023/11/13/how-to-build-string-from-list-in-python/#how-to-create-a-string-from-list-in-three-steps)
   1. [Using For-loop](https://srinimf.com/2023/11/13/how-to-build-string-from-list-in-python/#using-for-loop)
   2. [Using Join](https://srinimf.com/2023/11/13/how-to-build-string-from-list-in-python/#using-join)
2. [Conclusion](https://srinimf.com/2023/11/13/how-to-build-string-from-list-in-python/#conclusion)

![Converting List to String](https://i0.wp.com/srinimf.com/wp-content/uploads/2022/02/pexels-photo-209663.jpeg?resize=1880%2C1126&ssl=1)*Photo by Pixabay on Pexels.com*

*String-list-python*

## Converting List to a String

I have created a list of list_of_values. The list contains data of decimals, numbers, and words. When you print each item using a for loop, in the output, you will find each item in vertical order.

```
list_of_values = [1.0, 'this is a test', 2, 'c', 'hello world']
```

```
list_of_values = [1.0, 'this is a test', 2, 'c', 'hello world']
for v in list_of_values:
  print(v)
```

Output

```
1.0 
this is a test 
2 
c 
hello world 

** Process exited - Return Code: 0 ** 
Press Enter to exit terminal
```

Our requirements is to convert the list output to a string. You can do it in two ways. One is by using a for loop, and the other is by using the `Join` method.

### Using For-loop

The output displayed with a space. Similarly, you can get a string with a comma. The way you can say as converting list to string “without a Join”.

```
list_of_values = [1.0, 'this is a test', 2, 'c', 'hello world']
for v in list_of_values:
  print(v, end=' ')  # Space included in end as separator
```

Output

```
1.0 this is a test 2 c hello world 

** Process exited - Return Code: 0 ** 
Press Enter to exit terminal
```

### Using Join

Using the join method, you can convert a list to a string. When you specify a comma, the output will have commas. In this case, it is space. For your understanding, I have given the context with an example.

```
list_of_values = [1.0, 'this is a test', 2, 'c', 'hello world']
s = ' '.join([str(i) for i in list_of_values])
print(s)
```

Output

```
1.0 this is a test 2 c hello world 
** Process exited - Return Code: 0 ** 
Press Enter to exit terminal
```

## Conclusion

Converting a list to a string in Python can be achieved using two methods: the for-loop and the join method.

With the for-loop method, each item in the list is printed individually, providing a string representation of the list. On the other hand, the join method allows you to build a string. It does this by concatenating the elements of the list using a specified separator.

Both methods are effective ways to convert a list to a string. The choice between them depends on the specific requirements of your code.

By leveraging these techniques, you can manipulate and format lists in Python to suit your needs. Whether you are working with numbers, words, or a combination of both, these methods provide flexible solutions. They help in converting a list to a string.

Related[Append() vs Extend(): A Detailed Comparison for Python Lists](https://srinimf.com/2024/09/12/append-vs-extend-a-detailed-comparison-for-python-lists/)

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2023%2F11%2F13%2Fhow-to-build-string-from-list-in-python%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2022%2F02%2Fpython-covert-list-to-string.jpg%3Ffit%3D1200%252C675%26ssl%3D1&description=2%20Ways%20Converting%20List%20to%20String%20in%20Python)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2023/11/13/how-to-build-string-from-list-in-python/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2023/11/13/how-to-build-string-from-list-in-python/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2023/11/13/how-to-build-string-from-list-in-python/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2023/11/13/how-to-build-string-from-list-in-python/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%202%20Ways%20Converting%20List%20to%20String%20in%20Python&body=https%3A%2F%2Fsrinimf.com%2F2023%2F11%2F13%2Fhow-to-build-string-from-list-in-python%2F&share=email)
-

### Like this:

Like Loading…
