python Python 入門 ノート (36)辞書をfor文で処理をする 辞書をfor文で処理をする items()メソッドd = {'x': 100, 'y': 200}for v in d: print(v)xy上記ではキーと値が表示されません。items() メソッドd = {'x': 100, 'y... 2022.01.22 python
python Python 入門 ノート (35)zip関数 zip関数 複数のリストの要素を取得月曜日にappleとcofee, 火曜日にbananaとtea, 水曜日にorangeとbeerを摂取するとします。for loop で回してprint します。days = fruits = drink... 2022.01.21 python
python Python 入門 ノート (34)enumerate 関数 enumerate 関数for fruit in : print(fruit)appleorangebananai = 0for fruit in : print(i, fruit) i += 10 apple1 oran... 2022.01.21 python
python Python 入門 ノート (34)range関数 range関数num_list = for i in num_list: print(i)rangefor i in range(10): print(i)0123456789開始 終了for i in range(7, 10)... 2022.01.20 python
python Python 入門 ノート (33)for else for else文for fruit in : print((fruit))applebananaorangeelsefor fruit in : print((fruit))else: print('I ate all!... 2022.01.20 python
python Python 入門 ノート (32)for文 と break文 continue文 for文 と break文 continue文while文some_list = i = 0while i < len(some_list): print(some_list) i += 112345for文 イテレーター(反復... 2022.01.19 python
python Python 入門 ノート (31)input関数 input関数while loop と input関数Stringwhile True: word = input('Enter:') if word == 'ok': break print('next')... 2022.01.17 python
python Python 入門 ノート (30)while else文 while else 文whilecount = 0while count < 5: print(count) count += 101234while elsecount = 0while count < 5: prin... 2022.01.16 python
python Python 入門 ノート (29)while文と continue文と break文 while文と continue文と break文whilecount = 0while count < 5: print(count) count += 101234break ループを抜けるcount = 0while Tr... 2022.01.15 python
python Python 入門 ノート (28)Noneを判定する場合 Noneを判定する場合is_empty is NoneNone・・・・・何も値が入っていないことis_empty = Noneprint(help(is_empty))Help on NoneType object:class NoneTy... 2022.01.14 python