0 votes
1 view
in Python by (12.1k points)

I've attempted to check out the web for answers to split a string into an array of characters yet I can't locate a basic technique 

str.split(//) doesn't appear to work as Ruby does. Is there a basic method of doing this without looping?

1 Answer

0 votes
by (25.2k points)

You want list.

>>> s = "foobar"

>>> list(s)

['f', 'o', 'o', 'b', 'a', 'r']

Are you searching for a good course to learn python? Join the python course.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Oct 3, 2019 in Python by Sammy (47.8k points)
0 votes
1 answer
0 votes
2 answers
asked Oct 3, 2019 in Python by Tech4ever (20.3k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...