Novice ask for advice: in this case, why not quote the keyword parameters of the Python function?

beginner Python, for advice:

def print_dict(**person):
        print(person)

print_dict( a ="jack", b ="rose")
-sharp {"a": "jack", "b": "rose"}
The

parameter is preceded by two asterisks so that Python creates a dictionary to hold the argument. What I don"t understand is why when calling a function, the argument is a = "Jack" instead of "a" = "Jack" . Since an is the key to be placed in the dictionary, why not put it in quotation marks?

solution, thank you very much!

Feb.27,2021
The

string cannot be used as a variable, so it cannot be "a" = "jack".


  https://docs.python.org/3/tut.
also does not understand very thoroughly, welcome to add and correct.

Menu