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 5 years have passed since last update.

Python 競プロ メモ書き

Last updated at Posted at 2020-04-24

Pythonメモ

これは自分用の競プロ用メモです

小数点切り下げ

floor
import math
num=1.234
print(math.floor(num))

結果 

入力をリスト化

input_list
a=list(map(int,input().split()))

リストをprint

list
a=[1,2,3,4]
a=[str(i) for i in a]
L=' '.join(a)
print(L)

もともとstr型の場合3行目から

list
a=[1,2,3,4]
print(*a)

絶対値を求める

abs
a=5
b=7
c=a-b
print(abs(c))

結果
2

今後も勉強の過程で調べたことをメモ書きしていきます

0
0
2

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?