0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

リストの追加・削除等について(Ruby学習後のPython初学)

Posted at

#リストの追加・削除等

PythonのリストはRubyにおける配列のようなもの。

list.py
list = [0, 1, 2]
len(list)  #リストの要素数を調べる、この場合は3
list.append(3)  #リストの最後に要素を追加、この場合は2の次にカンマが入って3が入る
list.pop(3)  #リストの指定した番号の要素を削除、この場合は3が削除される

ちなみにcsvのファイルもカンマで区切られているリスト扱いとなるのでリスト操作できるということになる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?