0
2

More than 1 year has passed since last update.

【Python】メソッド一覧

Last updated at Posted at 2023-08-08

【Python】メソッド一覧

学んだメソッドをまとめてみた。


メソッド 内容
split(sep) 文字列をsepで分割したリストを返す
join(list) 引数のリストを連結した文字列を返す
replace(old, new) 文字列の中のoldで表される文字列をnewで置き換えた文字列を返す
strip() 文字列の先頭を末尾の空白文字を削除した文字列を返す
append() 1つのリストの要素追加
extend([ , ]) 複数のリストの要素追加。リスト[ ]で指定
remove() 指定した内容の要素の削除
clear() 要素の全削除                    
index() リストに特定の要素があるか確認
sorted() 小さい順にリストの要素の並び替え(1回限りの並び替え)
sort() 小さい順にリストの要素の並び替え(完全に並び替える)
copy() リストの要素をコピーする
update({'': '','':''}) 辞書に複数の要素追加
get() 辞書から要素を取り出す(キーが無くてもエラーが出ないようにする)
add() 集合に要素を追加
keys() 辞書のキーのビューを返す          
values() 辞書の値のビューを返す
items() (キー、値)のタプルのビューを返す
0
2
1

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
2