プログラミング勉強記録 - 9月29日
① 今日の学習
私が今練習しているプログラミング言語は、pythonです。
下のサイトを使って練習しています!
1. 今日のコードです!
2.「リスト」
methods that I learned today
・append --- to add an element
・insert (index value, 'an element')
--- to add the element between original elements
・ remove ('element') --- to delete an element
・pop (index value) --- to return value and delete an element
・index ('element') --- to know the index value of an element
・count ('element') --- to know how many same elements as an element in an argument there are in a list
② 気づいたこと
1. Two methods that are likely to be confusing
〈"tuple" and "list"〉
〇 a method, "tuple", works with "()", but another method, "list", works with "[]".
tuple のメソッドは、「 () 」使うと機能するが、
list の場合は、「 [] 」の時に機能する
〈"remove" and "pop"〉
〇 Both of two methods, "remove" and "pop", make an element deleted, but "remove" has element as an argument while "pop" has index value as an argument.
remove と pop はどちらも要素を消す役割があるが、
removeは、要素を因数にとり、popは、インデックス指数を因数にとる。
2. Question
・What kind of situation are "tuple" and "list" used separately?
どんな場面で「tuple」と「list」は使い分けられるの?
・What kind of situation are "remove" and "pop" used separately?
どんな場面で「remove」と「pop」は使い分けられるの?
この記事が気に入ったらサポートをしてみませんか?