ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 30 Jan 2022 20:21:14 +0100Checking multiple things with an if else statementhttps://ask.sagemath.org/question/60890/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.RuneSun, 30 Jan 2022 20:21:14 +0100https://ask.sagemath.org/question/60890/