This may be a very rudimentary question, but I am trying to use the following site to try the split
function.
Separate the string! Active engineers explain how to use split functions in Python [for beginners]
In that case, is it okay to write the following image in two lines in In[]
?
result='Online, Programming, Learning School, Tech Academy'.split(',')
["Online", "Programming", "Learning School", "Tech Academy"]
Even if I run it, the following appears as Out[]
, so I think it's probably wrong, but how do I display the split properly?
['Online', 'Programming', 'Learning School', 'Tech Academy']
Perhaps it is running on the Jupiter Notebook, and the referenced site says that it is running on the
result='Online, Programming, Learning School, Tech Academy'.split(',')
in result
will be replaced with ['Online', 'Programming', 'Learning School', 'Tech Academy']
print(result)
on the subsequent In and run it, ['Online', 'Programming', 'Learning School', 'Tech Academy']
That's right.
© 2024 OneMinuteCode. All rights reserved.