Python 单词字母顺序不变且所有倒排 您所在的位置:网站首页 uml14种图记忆 Python 单词字母顺序不变且所有倒排

Python 单词字母顺序不变且所有倒排

2023-08-14 03:43| 来源: 网络整理| 查看: 265

[A1]以空格为分隔符,将单词取出放入list中。

关于split():

string.split(s[, sep[, maxsplit]])

Return a list of the words of thestring s. If the optional second argument sep is absent or None, the words areseparated by arbitrary strings of whitespace characters (space, tab, newline,return, formfeed). If the second argument sep is present and not None, itspecifies a string to be used as the word separator. The returned list willthen have one more item than the number of non-overlapping occurrences of theseparator in the string. If maxsplit is given, at most maxsplit number ofsplits occur, and the remainder of the string is returned as the final elementof the list (thus, the list will have at most maxsplit+1 elements). If maxsplitis not specified or -1, then there is no limit on the number of splits (allpossible splits are made).

The behavior of split on an emptystring depends on the value of sep. If sep is not specified, or specified asNone, the result will be an empty list. If sep is specified as any string, theresult will be a list containing one element which is an empty string



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

      专题文章
        CopyRight 2018-2019 实验室设备网 版权所有