Jump in loop Python

Hello everyone,

So I have the following code as can be seen in the image. What I am trying to do is to let python perform the calculations only with a unique ‘g’ value. So for example Within the loop it should perform the first calculation but because the next ‘g’ value is repeating it should jump to the next unique ‘g’ value. Now it just breaks the loop and only calculates the first value. Any suggestions? Thanks in advance!

I don’t know python and you didn’'t attach your file.
But, try with “continue” instead of “break”.

1 Like

Hello,

You can remove duplicates by putting g into a set, so use

for a in x:
    for b in set(g):
        print a * b
1 Like