Code:
def myFun(*args, **kwargs): print("args: ", args) print("kwargs: ", kwargs) args = input("Enter args: ") kwargs = input("Enter kwargs: ") myFun(args,kwargs) Output:
Enter args: 1,2,3,4 Enter kwargs: a=5,b=6,c=7 args: ('1,2,3,4', 'a=5,b=6,c=7') kwargs: {} Process finished with exit code 0 Here the expected output is:
args: (1,2,3,4) kwargs: {'a':5,'b':6,'c':7} I am getting the output not as the expected output.
kwargsstring to a dict, and no converting strings to ints.