I have the following code:
for {for loop assertion }:
if (a) > 0 and b > 0:
print('same')
elif (a) < 0 and b < 0:
print('same')
else:
print('different')
This produces a list like this:
different
different
same
different
same
different
same
different
different
same
different
different
different
different
different
same
What I want to do is save this to another variable. Could you please advise how I can accomplish that?
print? You could just directlyappendinto a list instead.listobjects anddictobjects to organize your codeifshould be anelif, shouldn't it?