• Python question of the day

    Which line of code should replace '# Replace this line' in the following code snippet to get the result: 7
    def f1(a=1,b=2,c=3): return a+b+c
    v = {"a":6, "c":-1}
    # Replace this line
    The ** operator unpacks the key-value pairs in the dic- tionary and matches those with the keyword arguments. As the second keyword argument b is not declared in the dictionary, it is initialized to its default value.

    Top 100 python interview questions:

  • python bootcamp 2021
datai analytics