s = "hello python!"
s.split()
If you do s.split()
in the above code, it is saved as ["hello", "python!"]
based on the space, right? Instead, I want to save the spelling in ['h', 'e', 'l', ..., '!']
like this, what should I do?
I used str.split(//)
in Ruby, but I don't eat it in Python
Put list()
on the str
s = "hello python!"
print(list(s))
© 2025 OneMinuteCode. All rights reserved.