I need help with the list comprehension equivalent for the below normal loop code
a = [1,2,3]
b = []
for i in a :
if i == 2 :
b.append(i*2)
else :
b.append(i)
# the below list comprehension is filtering the list i don't know how to change it correctly
print([n*2 for n in a if n == 2 ] )
print(b)