Python String To Array Using List Comprehension

[Solved] Python String To Array Using List Comprehension | Haskell - Code Explorer | yomemimo.com
Question : Python String to array using list comprehension

Answered by : itsmycode

# Split the string to array of characters using list Comprehension
text1= "ABCDEFGH"
output1= [x for x in text1]
print(output1)
text2="A P P L E"
output2=[x for x in text2]
print(list(text2))

Source : https://itsmycode.com/how-to-convert-python-string-to-array/ | Last Update : Wed, 15 Dec 21

Answers related to python string to array using list comprehension

Code Explorer Popular Question For Haskell