+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"]

10/18/2019 4:34:34 PM

Csongor Kertesi

2 Answers

New Answer

+10

print(list("hi"))

+5

or using comprehension text = "hi" splitted = [i for i in text] Print(splitted)