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 1 year has passed since last update.

空白で分割された一行の標準入力をそれぞれ数値としてゲット

Posted at

標準入力で
4 5 6 10
のように与えられていたとする

この時、内包表記を使用することでそれぞれ変数として使うことができる

A, B, C, D = [int(i) for i in input().split()]
print(A + B + C + D) 

# 25
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?