Python - What is the output: function parameter with default value?

Question

What is the output of the following code?

def func(a, b=4, c=5): 
    print(a, b, c) 

func(1, 2) 


Click to view the answer

1 2 5

Note

1 and 2 are passed to a and b by position, and c is omitted in the call and defaults to 5.

Related Quiz