LoginSignup
0
0

More than 1 year has passed since last update.

自分用勉強メモ11日目

Last updated at Posted at 2019-05-25

調べた知識

Pythonで"*"を使用してリストの引数展開

リストを関数の引数に渡すときに,リストの前に"*"をつけると,中身を展開してから渡すことができる.

リストとタプルの場合は"*"を,辞書の場合は"**"をつけると展開できるらしい.

>>> arg_list = ['a', 'b', 'c']
>>> print(arg_list)
['a', 'b', 'c']
>>> print(*arg_list)
a b c
# print('a', 'b', 'c') と同じ
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