Q1. What is the output of the following code?
```python
def func(x=[]):
x.append(1)
return x
print(func())
print(func())
```
Output:
[1]
[1, 1]
Explanation: Default mutable arguments retain changes between calls.
Q2. What is the output of the following code?
```python
a = [1, 2, 3]
b=a
a.append(4)
print(b)
```
Output:
[1, 2, 3, 4]
Explanation: `a` and `b` refer to the same list object.
Q3. What is the output of the following code?
```python
for i in range(3):
print(i)
else:
print("Done")
```
Output:
0
1
2
Done
Explanation: The `else` block in a for loop runs when the loop doesn't exit via `break`.
Q4. What is the output of the following code?
```python
x = [i*i for i in range(5) if i%2 == 0]
print(x)
```
Output:
[0, 4, 16]
Explanation: List comprehension with condition filters even numbers.
Q5. What is the output of the following code?
```python
def f():
try:
return 1
finally:
return 2
print(f())
```
Output:
2
Explanation: The `finally` block overrides the return in `try`.