Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Checking multiple things with an if else statement

Is there a way to check multiple things in an if statement? I have a program in which I want to check if the degree of the lowest term of a polynomial is equal the degree of the lowest term of any polynomial in another list of polynomials. Essentially, what I have so far is:

def W(i):
d=set()
for w in range(0,d[i]):
    if ListBasis[i][w].polynomial().ord() notequal ListBasis[i-1][y].polynomial.ord():
        d.add(ListBasis[i][w])
    else:
return d

And what I would like to have is

def W(i):
F=set()
for w in range(0,d[i]):
    if for y in range(0,d[i]) ListBasis[i][w].polynomial().ord() notequal ListBasis[i-1][y].polynomial.ord():
        F.add(ListBasis[i][w])
    else:
return F

Clearly this is not the correct syntax for this, but I do not know what is.