Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what the fuck is a lambda
 
#4
yes, precisely! in this example here:
################################
example = lambda arg1, arg2 : print(arg1 + arg2)
example(25, 25) # --> 50
################################
"lamba arg1, arg2" are the arguments (essentially equiv. to def example(arg1, arg2)). after the ":" is where the code to the actual function goes. (in this case print(arg1 + arg2)).
Reply


Messages In This Thread
what the fuck is a lambda - by kwabockle - 06-19-2025, 11:11 PM
RE: what the fuck is a lambda - by queue - 06-19-2025, 11:21 PM
RE: what the fuck is a lambda - by kwabockle - 06-19-2025, 11:25 PM
RE: what the fuck is a lambda - by queue - 06-19-2025, 11:29 PM
RE: what the fuck is a lambda - by kwabockle - 06-19-2025, 11:35 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)