Sep-10-2018, 02:00 PM
(This post was last modified: Sep-10-2018, 02:00 PM by juniorcoder.)
Hello friends,
I have a very easy question but since I am a beginner I could not solve it.
I have a list like
a=[1 2 3 -4]
what I wanted to do
if (condition x>condition y and all the elements of list a is greater than 0)
do this
else:
do that
how can I check the each element of list a if they are greater than 0 on the "if" line?
Thank you so much
I tried to to do something like if (condition x>condition y and [n for n in a >0]:
but it did not work
I will be very happy, if you can help me
I have a very easy question but since I am a beginner I could not solve it.
I have a list like
a=[1 2 3 -4]
what I wanted to do
if (condition x>condition y and all the elements of list a is greater than 0)
do this
else:
do that
how can I check the each element of list a if they are greater than 0 on the "if" line?
Thank you so much
I tried to to do something like if (condition x>condition y and [n for n in a >0]:
but it did not work
I will be very happy, if you can help me