Answers for "what is the difference between split and strip in python"

0

strip in split python

my_string = "blah, lots  ,  of ,  spaces, here "
result = [x.strip() for x in my_string.split(',')]
# result is ["blah", "lots", "of", "spaces", "here"]
Posted by: Guest on December-16-2020

Code answers related to "what is the difference between split and strip in python"

Python Answers by Framework

Browse Popular Code Answers by Language