Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 20 Online
OpenStudy (anonymous):

In the lec9 ,there is a function sort(L,it = lambda x,y:x

OpenStudy (anonymous):

which course? OCW 2008, 2011 ? EDx2013? use a code pasting site and post the whole function along with any lines that call it. http://dpaste,com

OpenStudy (anonymous):

Without more it has hard to say exactly but I am guess the lambda part is the problem. It creates an anonymous (no name) function that takes two arguments and returns true or false. Here is an example. >>> it = lambda x,y:x<y >>> it <function <lambda> at 0x02974A30> >>> it(3, 4) True >>> it(4,3) False

OpenStudy (rsmith6559):

sort( L, it = lambda x,y:x<y ): looks to be a sort function being passed either a list, or a list and a comparison function that returns either True of False ( equal should be interesting! ). If no comparison function is passed, the lambda will be used.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!