回覆列表
  • 1 # 陶白

    舉例說明:

    >>> str=[1,2,3,4,5,2,6]

    >>> str.remove(2)

    >>> str

    [1, 3, 4, 5, 2, 6]

    >>> str=[0,1,2,3,4,5,6]

    >>> str

    [0, 2, 3, 4, 5, 6]

    >>> str2=["abc","bcd","dce"]

    >>> str2.pop(2)

    "dce"

    >>> str2

    ["abc", "bcd"]

    舉例說明:

    >>> str=[1,2,3,4,5,2,6]

    >>> del str[1]

    >>> str

    [1, 3, 4, 5, 2, 6]

    >>> str2=["abc","bcd","dce"]

    >>> del str2[1]

    >>> str2

    ["abc", "dce"]

    >>> str=[0,1,2,3,4,5,6]

    >>> str

    [0, 1, 4, 5, 6]

  • 中秋節和大豐收的關聯?
  • 羽絨服成分有哪些?