*args **kwargs
# *args **kwargs的用法 def get_data(name,age,*args,**kwargs): print(f"name:{name},age:{age},可变参数:{args},可变键值对参数:{kwargs}") if __name__ == '__main__': get_data('lily',3,'50kg','football','k','jj',tag=0.1) ''' name:lily,age:3,可变参数:('50kg', 'football', 'k', 'jj'),可变键值对参数:{'tag': 0.1} '''