「python入門」append()で要素を追加するサンプル
pythonコード:
>>> cftlist = [1,2,0,’test’]
>>> cftlist
[1, 2, 0, 'test’]
>>> cftlist.append(4)
>>> cftlist
[1, 2, 0, 'test’, 4]
>>> cftlist.append('data’)
>>> cftlist
[1, 2, 0, 'test’, 4, 'data’]
>>>
Coding Changes the World
pythonコード:
>>> cftlist = [1,2,0,’test’]
>>> cftlist
[1, 2, 0, 'test’]
>>> cftlist.append(4)
>>> cftlist
[1, 2, 0, 'test’, 4]
>>> cftlist.append('data’)
>>> cftlist
[1, 2, 0, 'test’, 4, 'data’]
>>>