Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

16
  • 23
    If you need the strip function, for example a map function, you can access it via str.strip(), like so map(str.strip, collection_of_s) Commented Nov 19, 2013 at 16:52
  • 2
    @killthrush Thanks for the reference, but I think you meant the rstrip() function. :-) Commented Jul 15, 2015 at 17:53
  • 29
    Sometimes I feel like python purposely avoids the well-accepted and meaningful names that the vast majority of languages use in order to be "unique" and "different" - strip instead of trim, isinstance instead of instanceof, list instead of array, etc, etc. Why not just use the names everyone is familiar with?? geez :P Commented Nov 3, 2015 at 18:10
  • 7
    @GershomMaes in strip's case, I completely agree, but a list is completely different from an array. Commented Apr 1, 2016 at 17:57
  • 2
    @Maëlan I'm not sure who "anyone sane" is, but C++, Python, Java and C# call an ordered, dynamically resizable collection of elements a list. Ruby and Javascript call it an array. Rust calls it a vector (I think). ¯_(ツ)_/¯ Commented Dec 3, 2018 at 21:07