Vidyalelo
Python · Q161

Functions in Python

Programming · Python · question 161

Q161

What will be the output of the following Python code? def foo(k): k[0] = 1 q = [0] foo(q) print(q)

A.
[0]
B.
[1]
Answer
C.
[1, 0]
D.
[0, 1]

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board