0
0

More than 3 years have passed since last update.

python構文メモ

Last updated at Posted at 2020-02-08

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=""

とりあえず完成しなそうなので今回はここら辺にして新しいの使ったら後から更新。

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0