1
Loading subject content…
Loading subject content…
Loading practice questions…
What is the output of the following code?
def f(x, lst=[]):
lst.append(x)
return lst
f(1)
print(f(2))What is the output of the following code?
def info(**kw):
return sorted(kw)
print(info(b=1, a=2))What is the output of the following code?
def fact(n):
return 1 if n <= 1 else n * fact(n - 1)
print(fact(6))What is the output of the following code?
def f(n):
return n * 2, n * 3
a, b = f(4)
print(a, b)