+ 3
Why string.split() doesn't work here !
string = 'abc' lst = string.split("") print(lst) Why this shows error?
6 Respuestas
+ 5
You can also directly use list function...
String="abc"
Lst=list(String)
+ 3
You can't have empty string in split function.
If you want each letter seperated you should try
" ".join("abc") which will return
a b c
If you want each letter separated inside list you should try
" ".join("abc").split(" ") which will return. ["a","b","c"]
Hope It Helps You!
+ 3
Hacker Badshah thanks
+ 2
Mirielle ohk thanks...!