0
1

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.

タプルのアンパッキング

Posted at
1
num_tuple = (10, 20)
print(num_tuple)
1の実行結果
(10, 20)
2
x, y = 10, 20
print(x, y)
2の実行結果
10 20
タプルの展開を使って値の入れ替え
i = 10
j = 20
print(i, j)
i, j = j, i
print(i, j)
タプルの展開を使って値の入れ替えの実行結果
10 20
20 10
0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?