The way he posted is for testing is not the best. he should have used max( or sum(
start with what we want to test against, as a list
then add the code to test if a is greater than it
now we have a list of boolean results (1 for true 0 for false).
if A is greater than any of those values, there will be a 1 in the list. if not, it will be all zeros.
test for all Zeros by using max or sum
Then add your if
Now the code lirtosiast posted earlier is faster, since it breaks it into a bunch of short lists
The way the calculator interperts this is as follows:
* test A against D and E.
* put the max as the last value in the list
* Test A against C
* Take the max of that value and the last one in the list
* set that as the new last item in the list
* Test A against B
* Take the max of that and the last item
* If there is a value, run the conditional
The reason this works is because it isnt actually ever storing it to a list, it is just doing 3 smaller computations which makes it slightly faster. Either way will work depending on if you are optimizing for speed or size.