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


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


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

Related Quiz