Write a Python program to convert a string to a list.
Answers
Answered by
0
Answer:
# Python code to convert string to list
def Convert(string):
li = list(string.split(" "))
return li
# Driver code
str1 = "Python Program convert"
print(Convert(str1))
Answered by
0
Answer:
Write a Python program to convert a string to a list.
Explanation:
# string conversion into list using python.
def Conversion(str):
li = list(str.split(" "))
return li
# Driver code
str1 = "This is a ball"
print(Convert(str1))
Output: -
['This', 'is', 'a','ball']
Similar questions
Hindi,
6 months ago
Political Science,
6 months ago
Math,
6 months ago
Economy,
1 year ago
English,
1 year ago