how do i change string to a list?

0 votes
can you give an example?
Mar 28 in Python by Waseem
• 4,270 points
89 views

1 answer to this question.

0 votes
suppose you have a string with a variable

name = 'edureka'

if you want to change this to a list, you can use the list constructor

res  = list(name)

print(res)

#this will give you the result as a list.
answered May 20 by Mohammad
• 3,060 points

Related Questions In Python

0 votes
1 answer

How to split a string into a list?

You can use the function  text.split() This should be ...READ MORE

answered Jul 30, 2018 in Python by Priyaj
• 56,520 points
41 views
0 votes
2 answers

How do I connect to a MySQL Database in Python?

connect mysql database with python import MySQLdb db = ...READ MORE

answered Mar 28 in Python by rajesh
• 1,210 points
124 views
0 votes
1 answer

In Python, how do I read a file line-by-line into a list?

with open(fname) as f:     content = f.readlines() # you ...READ MORE

answered Oct 9, 2018 in Python by SDeb
• 13,160 points
108 views
0 votes
1 answer

How do I convert a Python program to a runnable .exe Windows program?

Understand that every 'freezing' application for Python ...READ MORE

answered Oct 12, 2018 in Python by SDeb
• 13,160 points
49 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 176 views
+4 votes
6 answers
0 votes
1 answer

how do I check the length of an array in a python program?

lets say we have a list mylist = ...READ MORE

answered Mar 12 in Python by Mohammad
• 3,060 points
33 views
0 votes
1 answer

How to remove the duplicate values in a list?

a = [10,20,30,40,10,20,30,40,30,40,50,60] s = set(a) c = list(s) print(c) this ...READ MORE

answered Mar 20 in Python by Mohammad
• 3,060 points
16 views