Код: Выделить всё
def func(*args, **kwargs):
if args:
second_test(*args)
elif kwargs:
second_test(**kwargs)
def second_test(stringa, integera, floata):
print("Name: %s, Problems Correct: %d, Points: %f" % (stringa, integera, floata))
profile_1 = ["MyName", 21, 132.00]
func(*profile_1)
profile_1a = {'Name': 'MyName', 'Problems Correct': 21, 'Points': 132.00}
func(**profile_1a)
Код: Выделить всё
TypeError: second_test() got an unexpected keyword argument 'Name'
Подробнее здесь: https://stackoverflow.com/questions/575 ... -typeerror
Мобильная версия