Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (12.7k 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 (26.4k 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
asked Jan 5, 2021 in Python by laddulakshana (12.7k points)
0 votes
1 answer
asked Oct 3, 2019 in Python by Sammy (47.6k 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!

29.3k questions

30.6k answers

501 comments

104k users

Browse Categories

...