Is there any way to split a text in Python with ""? In JS: "Hello".split("") >> ["H","e","l","l","o"] in Python: doesn't work :( | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Is there any way to split a text in Python with ""? In JS: "Hello".split("") >> ["H","e","l","l","o"] in Python: doesn't work :(

text = "hi" {code} >> Output: ["h","i"]

18th Oct 2019, 4:34 PM
Csongor Kertesi
Csongor Kertesi - avatar
1 Answer
+ 10
print(list("hi"))
18th Oct 2019, 4:36 PM
Hatsy Rei
Hatsy Rei - avatar