Of course you get that output, because
Having said that, this is not really a good case for using a lambda because here all it does is complicate things. If you at least want to get used to passing functions around, then look at using lambdas with say,
check_angles returns
a function, which you then need to call.Having said that, this is not really a good case for using a lambda because here all it does is complicate things. If you at least want to get used to passing functions around, then look at using lambdas with say,
map
, filter
or even passing a function for the key
argument of the sorted
function (or the sort
method on sequences). reduce
is another example of a function that takes a function as an argument (a so-called "higher-order function"), but it might be a bit more complicated to understand how it works.