# Python String Split() Method

**URL:** https://forum.networklessons.com/t/python-string-split-method/10567
**Category:** Lessons Discussion
**Created:** [April 5, 2020, 10:40am UTC](https://forum.networklessons.com/t/python-string-split-method/10567 "2020-04-05T10:40:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [April 5, 2020, 10:40am UTC](https://forum.networklessons.com/t/python-string-split-method/10567/1 "2020-04-05T10:40:12Z")

</div>

This topic is to discuss the following lesson:

> **[Python String Split() Method](https://networklessons.com/python/python-string-split-method)**
>
> The Python String Split() method lets you split a string into a list with multiple strings. This is useful when you want to read CSV files.

---

<div class="post-metadata">

### Author: ![pradyumnayadavgla](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/p/f9ae1b/32.png) [@pradyumnayadavgla](https://forum.networklessons.com/u/pradyumnayadavgla)
#### Post date: [May 31, 2020, 8:04pm UTC](https://forum.networklessons.com/t/python-string-split-method/10567/2 "2020-05-31T20:04:45Z")

</div>

Hi Rene,

as per this eg:

 ![image](https://cdn-forum.networklessons.com/uploads/default/original/2X/4/4e66446616dc81bce9513e3697772001e35b3c89.png)  
'The stored output of the split() method must be this **[‘R1’, ‘IOS-XE’, ‘192.168.1.1’]** not this one **csv\_line = “R1,IOS-XE,192.168.1.1”**.

please clarify

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [June 4, 2020, 9:43am UTC](https://forum.networklessons.com/t/python-string-split-method/10567/3 "2020-06-04T09:43:00Z")

</div>

Hello Pradyumna

If the variable **csv\_line** is a string, then the output of that variable in the window on the right will be of the form “R1,IOS-XE,192.168.1.1”.

If the variable **csv\_line** is a list, then the output of that variable in the window on the right will be of the form [‘R1’, ‘IOS-XE’, ‘192.168.1.1’].

Notice in the following screenshot, initially, the output of csv\_line is with quotes, and separated by commas. After it is converted, it appears in square brackets, with each item of the list in single quotes, and separated by commas.

 ![image](https://cdn-forum.networklessons.com/uploads/default/original/2X/e/e122f24f5ce4c65938561c68f66afe6b85cebc6d.png)

I hope this has been helpful!

Laz
