i'm trying to flip the bits of a 32-bit binary number but somehow its not working properly. it doesnt even ask for an input. i dont know whats going on.
def flip_bits(k):
for j in range(len(k)):
if k[i] == 1:
k[i] = 0
elif k[i] == 0:
k[i] = 1
print(k)
if __name__ == '__init__':
t = int(input())
a = []
b = []
for i in range(t):
a.append(int(input()))
b.append(bin(a[i])[2:].zfill(32))
flip_bits(b)
if i remove the if name = 'init' part it takes the input but doesn't give me an appropriate output can u please direct me in the right path?