Komentáře •

  • @BroCodez
    @BroCodez Před 3 lety +22

    # Higher Order Function = a function that either:
    # 1. accepts a function as an argument
    # or
    # 2. returns a function
    # (In python, functions are also treated as objects)
    # ----- 1. accepts a function as an argument -----
    def loud(text):
    return text.upper()
    def quiet(text):
    return text.lower()
    def hello(func):
    text = func("Hello")
    print(text)
    hello(loud)
    hello(quiet)
    # ------------ 2. returns a function -------------
    #def divisor(x):
    #def dividend(y):
    #return y / x
    #return dividend
    #divide = divisor(2)
    #print(divide(10))

  • @arocien8009
    @arocien8009 Před 3 lety +5

    Thanks a bunch for the vid. It was really well explained with the examples!

  • @rajansahu6720
    @rajansahu6720 Před 3 lety +2

    Thank you, Nicely explained.
    Very cool outro video, love it too.

  • @andrek9251
    @andrek9251 Před 2 lety

    Well explained. Thank you!

  • @elliotcossins8417
    @elliotcossins8417 Před 2 lety

    Helped me out with returning HOF, btw your voice sounds like an almost perfect text to speech robot 🤣

  • @philippbeer
    @philippbeer Před rokem

    Simple nice introduction.

  • @user-vr2si8on9f
    @user-vr2si8on9f Před 11 měsíci

    excellent free knowledge

  • @timothymeregini9949
    @timothymeregini9949 Před rokem +1

    Hello fellow coders I new and this was a very VIDEO helpful. oops returned Loud

  • @aradhnasandhu2724
    @aradhnasandhu2724 Před 2 měsíci

    superb explanation. Thnx bro

  • @AmpereYOLO
    @AmpereYOLO Před 3 lety

    thank you so much!

  • @kelvincheng3103
    @kelvincheng3103 Před 2 lety

    Why on the first example the function is called with the () and how can we differentiate from a variable (as it could be mistaken by an variable)

  • @SuperStarEevee
    @SuperStarEevee Před 2 lety

    Thank you!

  • @wolmirduarte8609
    @wolmirduarte8609 Před rokem

    very useful, thanks

  • @paraglide01
    @paraglide01 Před rokem

    Great stuff, very good tutorial.

  • @porshkabir2535
    @porshkabir2535 Před 2 lety +6

    NEED ASSISTANCE ASAP, FOR THE SECOND ONE....
    how does divide(10) take the value to dividend(y)

    • @onlyLewds
      @onlyLewds Před 2 lety +14

      heya, i had this issue too, after thinking for abit, I think i got it, let me try to explain:
      after the line divide = divisor (2), x becomes 2 and it goes through the code, returning divident.
      so now the next line, divide(10) can be read as divident(10) because it returned divident, thus y=10, hope it helps!

    • @jean-paulmpindumukandila1251
      @jean-paulmpindumukandila1251 Před 2 lety +1

      @@onlyLewds Thanks

  • @joshuawalsh6968
    @joshuawalsh6968 Před rokem

    Good stuff.

  • @bekturasanbekov1979
    @bekturasanbekov1979 Před rokem

    thx 4 vid bro !

  • @justincreates5673
    @justincreates5673 Před 2 lety

    Thanks! I was srtuck on this

  • @gabrielrockson9399
    @gabrielrockson9399 Před 2 lety

    Really useful

  • @LearningIsHere
    @LearningIsHere Před 11 měsíci

    Good video

  • @beingzero7541
    @beingzero7541 Před 2 lety

    Wow!

  • @Crossnake
    @Crossnake Před 10 měsíci

    Good video bro

  • @EissaAlahdul
    @EissaAlahdul Před rokem

    Thanks!

  • @mahdiataei7625
    @mahdiataei7625 Před 3 měsíci

    Good content

  • @shricharanramesh7149
    @shricharanramesh7149 Před 24 dny

    yo the second example caught me off guard

  • @sachinsachinuh3709
    @sachinsachinuh3709 Před 5 měsíci

    Thank You Sir

  • @haurvatat2006
    @haurvatat2006 Před 2 lety +8

    i don't really understand the second example

    • @manuelvaal1257
      @manuelvaal1257 Před 2 lety +4

      he used function assigned to variable..the divisor(x=2) function returns dividend function.
      and then he assigned this result to divide variable. now the dive variable is acting as the dividend function with argument of 10.hope i sound clear

    • @angelicking2890
      @angelicking2890 Před 2 lety

      @@manuelvaal1257 ty that makes more sense.

    • @Digital-Light
      @Digital-Light Před 2 lety

      @@manuelvaal1257 thank you i understand your explanation

  • @ahiamatagabriel5696
    @ahiamatagabriel5696 Před 2 lety

    Thank you

  • @ThawanHenriquee
    @ThawanHenriquee Před 5 měsíci

    Niceee man

  • @lw9954
    @lw9954 Před rokem

    Thank you bro

  • @vitaliytysiachnyk5347
    @vitaliytysiachnyk5347 Před 10 měsíci

    Bro, please add English subtitles, because it's only Vietnam. Lol
    Thank you!
    You are the best

  • @naveenverma2951
    @naveenverma2951 Před 2 měsíci

    Splendid, spend hrs with gpt bbut didnt get it, here 5 mins. I like this crazy function itself traveling hiding behind innocent variable name. Will make code looks simple but cant be copy pasted

  • @rubenc4696
    @rubenc4696 Před 3 měsíci

    Thanks

  • @Rajkumar_Tripat
    @Rajkumar_Tripat Před rokem

    thanks bro

  • @QaiserMuhammad
    @QaiserMuhammad Před rokem +1

    I would always be grateful. For the last two days I had been stuck with decorators in python. You answered my question. 🌹 Thanks again.
    1) Liked
    2) Commented
    3) Subscribed

  • @FushigiMigi
    @FushigiMigi Před 2 lety +2

    I cannot wrap my head around the first one. The second one makes more sense if you write it like this:
    print(divisor(2)(10))

    • @paulbrugger9610
      @paulbrugger9610 Před rokem

      Very good!

    • @christiangreyson115
      @christiangreyson115 Před 7 měsíci

      wow thanks bro. I tried so hard to understand the logical of the 2nd one. but when I see your tips, it helps me a lot

  • @srs8074
    @srs8074 Před rokem

    Does anyone has best playlist to learn react js

  • @Franco-ss4bu
    @Franco-ss4bu Před rokem +1

    kinda mind boggling

  • @EissaAlahdul
    @EissaAlahdul Před rokem +1

    print(divisor(2)(10))

  • @farhan8834
    @farhan8834 Před rokem +1

    Here is my random comment for your BRO ❤

  • @umion9529
    @umion9529 Před 3 lety

    Man, I thought it called closure, is not it? (the seconds examp)

  • @HussainAli-sb1dv
    @HussainAli-sb1dv Před 8 měsíci

    love u

  • @franccc6160
    @franccc6160 Před rokem

    Trippy stuff, but interesting

  • @wmstram1
    @wmstram1 Před rokem

    I don't get the efficacy of this in the context of making code readable, Making less code maybe.

  • @Adamelamine
    @Adamelamine Před 2 lety

    drop a comment

  • @piotrkopcewicz5227
    @piotrkopcewicz5227 Před rokem +1

    higher order comment :P

  • @shavindasilva
    @shavindasilva Před 2 lety

    random comment ;)

  • @MukeshKumar-tg6rv
    @MukeshKumar-tg6rv Před rokem

    Sreen is not clear

  • @EissaAlahdul
    @EissaAlahdul Před rokem

    Thanks!

  • @Dunith_Munasinghe
    @Dunith_Munasinghe Před rokem

    Thank you

  • @orazovdidar
    @orazovdidar Před 3 měsíci

    Thanks

  • @ChimaevMikelson
    @ChimaevMikelson Před 8 měsíci

    Thanks Bro