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