def players(job, *args, **kwargs):
print(job)
print(args)
print(kwargs)
players('Brave', 'Warrior', 'Wizard', job1='Monk', job2='Magic swordsman')
Execution result
Brave
('Warrior', 'Wizard')
{'job1': 'Monk', 'job2': 'Magic swordsman'}
"Brave" in job ('Warrior','Wizard') in args are tuple type In kwargs, {'job1':'monk','job2':'magic swordsman'} in dictionary type It is stored.
However,
Recommended Posts