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!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 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 Réponse
+ 10
print(list("hi"))
18th Oct 2019, 4:36 PM
Hatsy Rei
Hatsy Rei - avatar