# Python, how to create a list from a string

> Learn how to create a list from a string in Python using the split() method, passing the separator like a space to break the string into a list of words.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2021-01-17 | Topics: [Python](https://flaviocopes.com/tags/python/) | Canonical: https://flaviocopes.com/python-howto-list-from-string/

Here is how you can create a [list](https://flaviocopes.com/python-lists/) from a [string](https://flaviocopes.com/python-strings/) in [Python](https://flaviocopes.com/python-introduction/).

First you need to decide how to cut the string. For example, every time there is a space.

You pass the `' '` word separator to the `split()` method that every Python string provides.

Example:

```python
phrase = 'I am going to buy the milk'
words = phrase.split(' ')

print(words)
# ['I', 'am', 'going', 'to', 'buy', 'the', 'milk']
```
