The strip function is a built-in function, correct? I don’t need to import anything. Am I doing something wrong or is this a bug? I’m so confused.
Strip only removes the designated character from the start and end of a string, not the middle.
I’d do the following instead:
print("".join(string.split(",")))
Where string
is the test sentence you screenshotted.