def players(job, *args, **kwargs):
print(job)
print(args)
print(kwargs)
players('勇者', '戦士', '魔法使い', job1='僧侶', job2='魔法剣士')
実行結果
勇者
('戦士', '魔法使い')
{'job1': '僧侶', 'job2': '魔法剣士'}
jobに'勇者'が
argsに('戦士', '魔法使い')がタプル型で
kwargsに{'job1': '僧侶', 'job2': '魔法剣士'}と辞書型で
格納されている。
ただし、
*1つが*2つよりも先でないと、
syntax errorとなるので注意。