美文网首页
Python 5 Programming Tutorial -

Python 5 Programming Tutorial -

作者: 豆表示低调 | 来源:发表于2016-08-30 14:22 被阅读0次
    >>> players = [29, 58, 66, 71, 87]
    >>> players[2]
    66
    >>> players[2] = 68
    >>> players
    [29, 58, 68, 71, 87]
    >>> players + [90, 91, 98]
    [29, 58, 68, 71, 87, 90, 91, 98]
    >>> players
    [29, 58, 68, 71, 87]
    >>> players.append(120)
    >>> players
    [29, 58, 68, 71, 87, 120]
    >>> players[:2]
    [29, 58]
    >>> players[:2] = [0, 0]
    >>> players
    [0, 0, 68, 71, 87, 120]
    >>> players[:2] = []
    >>> players
    [68, 71, 87, 120]
    >>> players[:] = []
    >>> players
    []
    

    相关文章

      网友评论

          本文标题:Python 5 Programming Tutorial -

          本文链接:https://www.haomeiwen.com/subject/meaxettx.html