In the last for loop I will to exclude execution of loop when Y=0 is met. How to I do it? [closed]

I think you are saying “if Y not equal to 0, then…”, which programmatically is:

if Y != 0

Updating your loop. I’m guessing you want to avoid the insert into F as well when Y is 0.

for n in  range(1001):
        h=N*nsv*G[n]*AF[n]
        Y=h.real
        if Y!=0:
            print(Y)
            p=math.log10(Y)
            F.insert(n,p)

Browse More Popular Posts

Leave a Comment