[Solved] a=’01101′ this has to be converted to [‘0′,’1′,’1′,’0′,’1’] ?? IN PYTHON [duplicate]


There is a function called list to do this directly.This can convert any string into list of characters.

list('01101')

will return

['0', '1', '1', '0', '1']

One more way is

a="01101"
a_list=[]
for item in a:
    a_list.append(item)
print(a_list)

5

solved a=’01101′ this has to be converted to [‘0′,’1′,’1′,’0′,’1’] ?? IN PYTHON [duplicate]