String.strip() in Python

后端 未结 5 1821
感情败类
感情败类 2021-01-30 03:07

While learning about python, I came upon this code, which takes a text file, splits each line into an array, and inserts it into a custom dictionary, where the array[0] is the k

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-30 04:02

    strip removes the whitespace from the beginning and end of the string. If you want the whitespace, don't call strip.

提交回复
热议问题