Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question about using lambda
#2
Note that in the second case you are not assigning the arguments (12 and 3) to a variable, your are assigning the return value (36) to a variable. In the first case, you don't assign the result (return value) of r(12, 3) to anything, so it just disappears. Functions don't store their return value. When you print r, it just prints the function object, which is just a note that r is a lambda function stored at a particular address.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Question about using lambda - by hikerguy62 - Aug-17-2019, 12:09 AM
RE: Question about using lambda - by ichabod801 - Aug-17-2019, 02:19 AM
RE: Question about using lambda - by perfringo - Aug-17-2019, 07:18 AM
RE: Question about using lambda - by ThomasL - Aug-18-2019, 09:04 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple code question about lambda and tuples JasPyt 7 3,667 Oct-04-2021, 05:18 PM
Last Post: snippsat
  Newbie question to use lambda on multiple columns of a dataframe zydjohn 0 5,911 Jan-23-2018, 06:08 PM
Last Post: zydjohn
  Newbie lambda question Truman 6 5,190 Dec-11-2017, 11:21 PM
Last Post: Truman

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020