pythonメモ
python入門することになったのでよく構文を忘れるのでここにメモしておく。
基礎の基礎から。
for文
for 変数 in オブジェクト:
処理
if文
if 条件式:
trueの時の処理
elif 条件式:
elifの時の処理
else:
ifとelif以外の時の処理
リスト
list = ["値1","値2","値3"]
ディクショナリ
dictionary = {"キー":"値","キー":"値","キー":"値"}
多次元リスト
list2 = [["値1","値2","値3"],["値4","値5","値6"]]
print関数出力の文末で改行しないためのオプション引数
end=""
とりあえず完成しなそうなので今回はここら辺にして新しいの使ったら後から更新。