String and list both are the different data type of different domain and structure of both data type is different. So when we want to convert string to list, we must aware of string as well as list in python.
Example of conversion-
String1='Mytext'
And we want to make a list which is look like –
List= ['M', 'y', 't', 'e', 'x', 't']
In this example we take item of string one by one according to index and append in the list so we get require list.
Program-
s="Mytext"
l=list(s)
print(l)
print(len(s))
print(len(l))
if len(s)==len(l):
print("length of both is same")
else:
print("Length of both is not same")
['M', 'y', 't', 'e', 'x', 't']
6
6
length of both is same