Help SQL Guided Project: Designing and Creating a Database

Screen Link:

Your Code: ```
“D” || CAST({hv}player{num}_def_pos AS INT)
FROM game_log
WHERE {hv}player{num}_id IS NOT NULL;


for hv in [“h”,“v”]:
for num in range(1,10):
query_vars = {
“hv”: hv,
“num”: num
run_command(template.format(**query_vars)) ‘’’

Other details: Pls, someone explain for me why we need use ** before query_vars in the last code line ?

Best answer which explains this in great details is here.

In short, the *args and **kwargs is a common idiom to allow arbitrary number of arguments to functions.

1 Like