Python Lambda Functions Explained

Поделиться
HTML-код
  • Опубликовано: 4 окт 2024

Комментарии • 36

  • @TechWithTim
    @TechWithTim  9 дней назад

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

  • @TheHeroIsRisingUp
    @TheHeroIsRisingUp 3 месяца назад +8

    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 2 месяца назад +2

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

  • @johnnytoobad7785
    @johnnytoobad7785 3 месяца назад +4

    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.

  • @MakeDataUseful
    @MakeDataUseful 3 месяца назад +19

    Watch on 2x and do it in 4

  • @facilvenir
    @facilvenir 3 месяца назад

    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 2 месяца назад

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

  • @JorgeEscobarMX
    @JorgeEscobarMX 3 месяца назад

    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 3 месяца назад

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

  • @Betadesk
    @Betadesk 3 месяца назад +1

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

  • @Makebuildmodify
    @Makebuildmodify 3 месяца назад +1

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

  • @augustinradjou3909
    @augustinradjou3909 3 месяца назад

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

  • @softwareengineer8923
    @softwareengineer8923 3 месяца назад

    It has been a lovely recap, thanks a lot👍

  • @cvought1
    @cvought1 3 месяца назад

    Thanks; helped my understanding so much!

  • @Artemis0307
    @Artemis0307 3 месяца назад +1

    i like this bro thanks

  • @icenreyes
    @icenreyes 3 месяца назад

    Gotta love this guy!

  • @JorgeEscobarMX
    @JorgeEscobarMX 3 месяца назад

    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.

  • @legojenn
    @legojenn 3 месяца назад +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 3 месяца назад +2

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

  • @mintz347
    @mintz347 3 месяца назад

    Do more projects based courses!!

  • @dominiquecoladon8343
    @dominiquecoladon8343 3 месяца назад

    Excellent video

  • @Craxy65
    @Craxy65 3 месяца назад +1

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

  • @Qbiccx
    @Qbiccx 2 месяца назад

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

  • @randylplampin1326
    @randylplampin1326 3 месяца назад

    I'm familiar with Lisp Lambda functions.

  • @liubomirberberoff7784
    @liubomirberberoff7784 3 месяца назад

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

  • @DrDeuteron
    @DrDeuteron 3 месяца назад

    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!?

  • @MLGJuggernautgaming
    @MLGJuggernautgaming 3 месяца назад

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

    • @DrDeuteron
      @DrDeuteron 3 месяца назад

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

    • @MLGJuggernautgaming
      @MLGJuggernautgaming 3 месяца назад

      @@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 3 месяца назад

    RUclips Template 😢

  • @trevoro.9731
    @trevoro.9731 3 месяца назад

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

  • @pratyush-se5pr
    @pratyush-se5pr 3 месяца назад +2

    1st view on the video

  • @MuhammadDaudJan
    @MuhammadDaudJan 3 месяца назад +1

    Bro fell off