So your first question… The reason you’re just getting the last item outputted is that you’re creating a variable dataEnteringNode, then you are setting it’s value to IN, then you are changing it’s value to IN etc. so when you run your test, it is against the final value you have set it to… 400.
Tomasz solved the 2nd part of your question.
I’m afraid there’s quite a lot wrong with your Python (and I’m no expert).
I recommend the free course at CodeAcademy https://www.codecademy.com/learn/learn-python or if you have a Lynda account, there is a course there also.
Here’s my version of what you’re kind of trying to do… I’ve had to adjust it a bit to make sense…
You’re feeding in several values (usually in Dynamo you’re feeding in 1 list of several numbers). Usually when you do this you define each of the inputs separately. Then you need to add them to a list and test them sequentially. I’ve shown the usual way (Append) but also a way of adding several values (extend).
Edit: As noted below, because every input is being used in the For Loop, you don’t need
num0 = IN or append etc. etc., you can just type
listnums = IN and use that list. However this is an unusual case.
Other things to note…
An Elif needs to be terminated by an Else.
Edit: as described below this is incorrect, however for the purposes of this code, it is more efficient to use else.
You’re feeding in numbers upto 400, but you’re testing for anything which is over 400?
You have put your output in which is why it’s coming out as a list. In order to run the For Loop the list was already created, so you can just output y
I hope that helps,