![](https://s.togetter.com/static/web/img/placeholder.gif)
ノンプロ研初心者プログラミング講座【Pythonコース第11期】第3回
-
kudou32323
- 586
- 2
- 0
- 0
![](https://s.togetter.com/static/web/img/placeholder.gif)
タプルのカッコは省略できる(滝汗) タプルのカッコは省略できる(滝汗) タプルのカッコは省略できる(滝汗) #ノンプロ研 #Python講座
2023-06-12 21:06:50![](https://s.togetter.com/static/web/img/placeholder.gif)
タプルの丸括弧は省略ができる。 10, 20 はタプルです! (10, 20) と同じなんです! #ノンプロ研 #Python講座
2023-06-12 21:07:17![](https://s.togetter.com/static/web/img/placeholder.gif)
タプルの括弧は省略可能 ()が省略されているけどタプルです #ノンプロ研 #Python講座 pic.twitter.com/0Ub3GqAceA
2023-06-12 21:08:30![](https://s.togetter.com/static/web/img/placeholder.gif)
![](https://s.togetter.com/static/web/img/placeholder.gif)
説明ツイート断念・・・あとで動画見直す・・・ #ノンプロ研 #Python講座 pic.twitter.com/25xMQpEpny
2023-06-12 21:09:23![](https://s.togetter.com/static/web/img/placeholder.gif)
![](https://s.togetter.com/static/web/img/placeholder.gif)
タプルは1つしか要素がないとき、末尾にカンマがつきます。 ✕ (10) ◯ (10,) #ノンプロ研 #Python講座
2023-06-12 21:09:32![](https://s.togetter.com/static/web/img/placeholder.gif)
リストもタプルもアンパックできるよ(V)o¥o(V) #ノンプロ研 #Python講座 pic.twitter.com/rxdP1DcXBa
2023-06-12 21:11:45![](https://s.togetter.com/static/web/img/placeholder.gif)
![](https://s.togetter.com/static/web/img/placeholder.gif)
![](https://s.togetter.com/static/web/img/placeholder.gif)
「タプルの丸括弧は省略できる」というよりは「タプルはカンマで作る」がしっくりきますね(V)o¥o(V) #ノンプロ研 #Python講座
2023-06-12 21:14:34![](https://s.togetter.com/static/web/img/placeholder.gif)
タプルは丸括弧だけでは作れません。カンマでタプルが作れます! #ノンプロ研 #Python講座 pic.twitter.com/hpPIejUDJI twitter.com/kanimiso_gs/st…
2023-06-12 21:17:00![](https://s.togetter.com/static/web/img/placeholder.gif)
![](https://s.togetter.com/static/web/img/placeholder.gif)
Q. 演習3-10をもっかい説明して! A. numbers + (20,)では元のnumbersには変更が加わりません。numbers =+ (20,) のように累計演算子を使うと、元のnumbers に変更が加わって20が要素に追加されます。 #ノンプロ研 #Python講座
2023-06-12 21:22:13![](https://s.togetter.com/static/web/img/placeholder.gif)
本日の最後は、辞書です! 辞書は波括弧で囲い、要素はキーと値をコロンで対にします。 {'name': 'Kani', 'favorite': 'Miso'} #ノンプロ研 #Python講座
2023-06-12 21:24:36![](https://s.togetter.com/static/web/img/placeholder.gif)
辞書の参照 person = {'name': 'Kani', 'favorite': 'Miso'} person['name'] →「Kani」が取得できます #ノンプロ研 #Python講座
2023-06-12 21:25:38![](https://s.togetter.com/static/web/img/placeholder.gif)
辞書の要素の追加 person = {'name': 'Kani', 'favorite': 'Miso'} person['age'] = 22 →辞書 person に age というプロパティが増えて、22が代入されます #ノンプロ研 #Python講座
2023-06-12 21:27:01![](https://s.togetter.com/static/web/img/placeholder.gif)
BobはTimが好きです💛 Bobはこの子でTimはベアです🐻 #ノンプロ研 #Python講座 pic.twitter.com/q1heyTVYNd
2023-06-12 21:27:05![](https://s.togetter.com/static/web/img/placeholder.gif)
なぜカッコにくるまれている?? とおもっていたら、先生からコメントが! → カンマで区切ったから!! おおおおお #ノンプロ研 #Python講座 pic.twitter.com/sP6yjjZ4ot
2023-06-12 21:29:36![](https://s.togetter.com/static/web/img/placeholder.gif)
![](https://s.togetter.com/static/web/img/placeholder.gif)
なるほど、print文を使わずに複数の値を出力したい場合はタプルにしちゃえば中身確認できるのか #ノンプロ研 #Python講座 pic.twitter.com/R0vXmmwA2T
2023-06-12 21:30:25![](https://s.togetter.com/static/web/img/placeholder.gif)
![](https://s.togetter.com/static/web/img/placeholder.gif)
『辞書はインデックスをキーにしないので、リストやタプルと同じようにインデックスでは参照できません。辞書のメリットはキーに意味をもたせられること。』 #ノンプロ研 #Python講座
2023-06-12 21:32:06![](https://s.togetter.com/static/web/img/placeholder.gif)
リストやタプルにin演算子を使うと、要素(値)が存在するかを確認することができました。辞書にin演算子を使うと、キーが存在するかどうかを確認できます。 person = {'name': 'Kani', 'favorite': 'Miso'} 'age' in person → 「age」というキーを持たないのでFalseです。 #ノンプロ研 #Python講座
2023-06-12 21:34:20![](https://s.togetter.com/static/web/img/placeholder.gif)
第3回は宿題の数は第2回の半分です。 が! 1つ1つが重いです!!! 1日1個やるつもりでがんばりましょう(/・ω・)/ #ノンプロ研 #Python講座
2023-06-12 21:40:09