Python Lambda Functions Explained

Поділитися
Вставка
  • Опубліковано 10 гру 2024

КОМЕНТАРІ • 41

  • @TechWithTim
    @TechWithTim  2 місяці тому

    To learn programming and Python - check out Datacamp!
    💻 Learn Python - datacamp.pxf.io/daN0E3
    💻 Learn Programming - datacamp.pxf.io/MmGxWY

  • @TheHeroIsRisingUp
    @TheHeroIsRisingUp 5 місяців тому +9

    This guy was my motivation when I got into programming 2 years ago. Thank you! Lamda function and JavaScript's map function were so complicated I remember. Thanks for clarifying.

  • @PraveenC-k3l
    @PraveenC-k3l 4 місяці тому +3

    bro you earned a subscriber by just passing two parameter in lambda

  • @TheLostEngineer-xb8iy
    @TheLostEngineer-xb8iy Місяць тому

    clear and concise explanation, you probably don't know how many concepts you have clearly explained within 8min. Thank you!

  • @johnnytoobad7785
    @johnnytoobad7785 5 місяців тому +6

    I believe "lambda" functions were first introduced in the LISP language.
    They are used (and in some cases required) in setting up certain "events" in TkInter.

  • @facilvenir
    @facilvenir 5 місяців тому

    I was just thinking about learning more about the lambda function and you go and make this video! That's a like before even watching it.

  • @shivams417
    @shivams417 4 місяці тому

    thanks tim for covering it, well explained with possible usecases, need more such advance python wizardry vids, :)

  • @JorgeEscobarMX
    @JorgeEscobarMX 5 місяців тому

    Thank you.
    These are advanced subjects, but never really explained step by step as you do, so it's actually really simple.
    I think I'm refactoring a lot of @static methods now that I know how to remove them.

    • @DrDeuteron
      @DrDeuteron 5 місяців тому

      I don't understand the line btw lambda and static methods?

  • @Makebuildmodify
    @Makebuildmodify 5 місяців тому +1

    A 5:10 is that concatenation to create the key?

  • @augustinradjou3909
    @augustinradjou3909 5 місяців тому

    With lambda all other functions also revised nice video..❤

  • @youvin4907
    @youvin4907 16 днів тому +1

    Difference between
    lambda arguments: expression
    And
    lambda parameters:expression

  • @MakeDataUseful
    @MakeDataUseful 5 місяців тому +20

    Watch on 2x and do it in 4

  • @softwareengineer8923
    @softwareengineer8923 5 місяців тому

    It has been a lovely recap, thanks a lot👍

  • @cvought1
    @cvought1 5 місяців тому

    Thanks; helped my understanding so much!

  • @Betadesk
    @Betadesk 5 місяців тому +1

    Is that lambda calculus in the thumbnail? Props for doing your research

  • @icenreyes
    @icenreyes 5 місяців тому

    Gotta love this guy!

  • @dominiquecoladon8343
    @dominiquecoladon8343 5 місяців тому

    Excellent video

  • @JorgeEscobarMX
    @JorgeEscobarMX 5 місяців тому

    Re-watching this today. I need to create multi-line lambda expressions to replace/refactor functions that exists only to be passed as arguments to other funtions/methods.

  • @Artemis0307
    @Artemis0307 5 місяців тому +1

    i like this bro thanks

  • @mintz347
    @mintz347 5 місяців тому

    Do more projects based courses!!

  • @Qbiccx
    @Qbiccx 5 місяців тому

    Why did he print the sorted list as list() and not directly?

  • @liubomirberberoff7784
    @liubomirberberoff7784 5 місяців тому

    "In this video you will learn about the lambda function in just a few minutes"
    Aight bet?

  • @legojenn
    @legojenn 5 місяців тому +3

    Why are lambda functions so hard to get my head around? I think that I understand, then I don't. Maybe it's overthinking?

    • @DrDeuteron
      @DrDeuteron 5 місяців тому +2

      Overthinking:
      lambda x: x**2
      is
      "f(x) = x**2"
      wherever it appears.

  • @randylplampin1326
    @randylplampin1326 5 місяців тому

    I'm familiar with Lisp Lambda functions.

  • @Craxy65
    @Craxy65 5 місяців тому +1

    Plz make next video on
    :how to make our robot talk and listen by coding
    Well' you are best teacher in world

  • @DANNYEL20122
    @DANNYEL20122 2 дні тому

    quick question: why on earth will i want to use this function if i can write out normal functions?

  • @DrDeuteron
    @DrDeuteron 5 місяців тому

    You missed a major "feature" of lambda that allows evil code: it has global scope:
    >>> f = lambda: x * n
    >>>f(3)
    NameError
    >>>n = 10
    >>>f(3)
    30
    >>>n = 'wtf'
    >>>f(3)
    'wtfwtfwtf'
    WTF!?

  • @dn7949
    @dn7949 16 днів тому

    Wait, so variables in Python are just functions?

  • @pratyush-se5pr
    @pratyush-se5pr 5 місяців тому +2

    1st view on the video

  • @MLGJuggernautgaming
    @MLGJuggernautgaming 5 місяців тому

    It’s a shame they don’t just have multi line lambdas or an explicit return

    • @DrDeuteron
      @DrDeuteron 5 місяців тому

      but it's an "in-line" function.

    • @MLGJuggernautgaming
      @MLGJuggernautgaming 5 місяців тому

      @@DrDeuteron it could just as easily not be, no? I guess it’s a weak argument. Python has dynamic variables so you can pass a function anywhere. But most languages have true lambda functions, why can’t Python?

  • @viddeshk8020
    @viddeshk8020 5 місяців тому

    UA-cam Template 😢

  • @karannchew2534
    @karannchew2534 Місяць тому

    Content is too "flashy". Confusing and annoying to watch.

  • @trevoro.9731
    @trevoro.9731 5 місяців тому

    Lambda functions are a trash implementation of anonymous functions - they are only lambda expressions in Python.

  • @MuhammadDaudJan
    @MuhammadDaudJan 5 місяців тому +1

    Bro fell off