Open otaniteruaki opened 3 years ago
sample_dict = {'apple': 'りんご', 'orange': 'オレンジ', 'banana': 'バナナ'}
sample_dict = {} # 空の辞書
sample_dict['peach'] = 'もも'
print(sample_dict['apple']) # -> りんご
for key, value in stationery.items():
if 条件A: 条件Aを満たした時の処理 elif 条件B: 条件Bを満たした時の処理 else: 条件を満たさない時の処理
for 変数 in range(繰り返す回数): 繰り返し中に実行する処理
def 関数名(引数1,引数2): 実行する処理
class Student: def avg(self): print(80+70)
⑴ データ形式
リスト(list)
辞書(dict)
sample_dict = {'apple': 'りんご', 'orange': 'オレンジ', 'banana': 'バナナ'}
sample_dict = {} # 空の辞書
sample_dict['peach'] = 'もも'
print(sample_dict['apple']) # -> りんご
for key, value in stationery.items():
という使い方データの整形
ファイルの入出力
⑵プログラミングの基本構造
if文
繰り返し
⑶関数
関数
クラス(アトリビュート:変数、メソッド:関数)とインスタンス