How to convert a string to list in python?

In Python it is very simple to convert a string into list .

Input:: ‘PyGround.in’

output: [‘P’, ‘y’, ‘G’, ‘r’, ‘o’, ‘u’, ‘n’, ‘d’, ‘.’, ‘i’, ‘n’]

In above input we have a sequence of character in a string  , here we have to convert each character as a list element.

>> my_str = ‘PyGround.in’
>>> my_list = list(my_str)
>>> print (my_list)
[‘P’, ‘y’, ‘G’, ‘r’, ‘o’, ‘u’, ‘n’, ‘d’, ‘.’, ‘i’, ‘n’]

 

This is the most pythonic way to get that done.

9 thoughts on “How to convert a string to list in python?”

  1. I know this if off topic but I’m looking into starting my own blog and was curious
    what all is needed to get set up? I’m assuming having a blog like
    yours would cost a pretty penny? I’m not very internet savvy so I’m not
    100% positive. Any suggestions or advice would be greatly appreciated.

    Cheers

  2. Good day! This is my first comment here so I just wanted to give
    a quick shout out and tell you I truly enjoy reading your posts.

    Can you recommend any other blogs/websites/forums that go over the same subjects?

    Thanks a ton!

  3. You’re so interesting! I do not think I’ve truly read through something like that before. So great to discover somebody with some unique thoughts on this subject matter. Really.. thank you for starting this up. This website is one thing that is required on the web, someone with a bit of originality!

  4. An impressive share! I’ve just forwarded this onto a colleague who has been conducting a little research on this. And he in fact ordered me lunch due to the fact that I found it for him… lol. So let me reword this…. Thank YOU for the meal!! But yeah, thanx for spending the time to talk about this topic here on your web page.

  5. At the beginning, I was still puzzled. Since I read your article, I have been very impressed. It has provided a lot of innovative ideas for my thesis related to gate.io. Thank u. But I still have some doubts, can you help me? Thanks.

  6. Read reviews and was a little hesitant since I had already inputted my order. or possibly a but thank god, I had no issues. simillar to the received item in a timely matter, they are in new condition. either way so happy I made the purchase. Will be definitely be purchasing again.
    cheap jordans https://www.realjordansshoes.com/