41. What will be the output of the following Python code?
lst = [1, 2, 3]
lst[3]
lst = [1, 2, 3]
lst[3]lst = [1, 2, 3]
lst[3]def a():
try:
f(x, 4)
finally:
print('after f')
print('after f?')
a()x=10
y=8
assert x>y, 'X too small'#generator
def f(x):
yield x+1
g=f(8)
print(next(g))valid = False
while not valid:
try:
n=int(input("Enter a number"))
while n%2==0:
print("Bye")
valid = True
except ValueError:
print("Invalid")def foo():
try:
return 1
finally:
return 2
k = foo()
print(k)