0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Pythonのインデントと文字列フォーマット

Posted at

Pythonのインデントと文字列フォーマット

インデント

インデントは1~いくつまでもでき、違う数同士でやると、エラーが出る。インデント = スペース

文字列フォーマット

これらで文字列と文字列を合体できる。

print("xxx{}xxx".format(a))
print("xxx{1}xx{0}x".format(a,b))
print("xxx%sxx%sx"%(a,b))
print(f"xxx{b}xx{a}x")
0
0
0

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?