# Decorator = A function that extends the behavior of another function # w/o modifying the base function # Pass the base function as an argument to the decorator def add_sprinkles(func): def wrapper(*args, **kwargs): print("*You add sprinkles 🎊*") func(*args, **kwargs) return wrapper def add_fudge(func): def wrapper(*args, **kwargs): print("*You add fudge 🍫*") func(*args, **kwargs) return wrapper @add_sprinkles @add_fudge def get_ice_cream(flavor): print(f"Here is your {flavor} ice cream 🍨") get_ice_cream("vanilla")
@akanjiadeola98154 ай бұрын
Can you do power apps tutorial
@XShow.__999M4 ай бұрын
you are boss
@udoydas65134 ай бұрын
bro plz cover react advanced topics
@الطلبحامزا4 ай бұрын
Please also make a video of kotlin language also
@NoName-is3tu4 ай бұрын
I had some doubts regarding this topic today...and you just clutched at right time and solved my problem...thank you bro code!
@michellguzelgul42672 ай бұрын
This is the clearest explanation I have heard. Thank you.
@Ann-pj7ie3 ай бұрын
you made the concept very clear in simple way..thank you very much
@ujjwaljohn17894 ай бұрын
bro you are the best programing teacher on the youtube ...... bro i beg to say please make the complete react course from beginner to advance ...... so it must be very helpful for those people who cannot afford expensive class or intuition...bro thankyou soo much once again....💓💓💐💐🤗🤗...
@mariamhasan373319 күн бұрын
Great explanation!
@alexn7208Ай бұрын
the best video for decorators finally i got it bro thanks
@lachaisegaming82633 ай бұрын
didn't saw the time going, very helpful tutorial thx
@Abdullo_11244 ай бұрын
Your every single video is useful & meaning full Thanks for the video Bro😃
@Greenbay-bn3yk4 ай бұрын
Hey bro. this is one of the topics I expected from you. Thanks man!
@fordayinlife4 ай бұрын
I 100% thought the poop emoji was coming with fudge. Nice video!
@hamdiakkob792511 күн бұрын
I have a question, but before I gotta say you're amazing man!! You don't care about the complex terms and you explain it so simply, and you also talk about why every piece is there with reasonable examples. I could have gone to documentaries and spent a good hour on them but here I am with a solid understanding of the basics of the topic within 7 minutes. Question is, what do we need the func for? Is it a representative of the get_ice_cream function, or any function that we add this Decorator to?
@dankwabismark25984 күн бұрын
Yeah its just an argument. So any function you add the decorator to will be passed to it. Its not specific to the get_ice_cream function
@hamdiakkob79254 күн бұрын
@@dankwabismark2598 thank you very much
@Pradeep-mh9uiАй бұрын
Thanks!
@AbelFikadu-lt1ei4 ай бұрын
Thanks bro very helpful😀
@dendell88604 ай бұрын
Doubt cleared.. Thank you Sir
@a7md87624 ай бұрын
Nice video Bro 👍
@morningwood39382 ай бұрын
Bro Code. You are the best.
@0ZANGETSUFLASH02 ай бұрын
wow ur god at explaining
@TroddenAnimations4 ай бұрын
Do more java videos, make games
@airslav3 ай бұрын
bro thank you very much🙏
@RicksterTheTrickster124 ай бұрын
W work
@UmairAhmad-9114 ай бұрын
Dude you are an actual bro
@swkratis67874 ай бұрын
Why do this and not call the function. Its a genuine question. Thanks to whoever responds
@ALPHAAR79 күн бұрын
Calling through decorators using @at top
@pokerchannel6991Ай бұрын
I played it at 2x speed, such that I got python decorators in 3.5 minutes.
@manjuch33452 ай бұрын
I have one doubt ,when we call multiple decorators we are using the func() within the wrapper right.At that time, base function will calling 2 times or not
@quyeny2kАй бұрын
The add_sprinkles decorator is called first. Then within this decorator, it calls the add_fudge decorator. Eventually the base function, get_ice_cream is called. You can think like this, the add_sprikles extends the add_fudge, which extends the get_ice_cream function
@mohamedcoufi98734 ай бұрын
What is the use of the word in parentheses(func)*?
@ashimsarkar6624 ай бұрын
See the python full course this are arguments and key arguments
@excelakachukwu266022 күн бұрын
I am still having difficulties understanding this topic. and more recommended videos?
@sameerroshan95422 ай бұрын
why is it not calling func() per decorator when you have multiple decorators. Why isnt it printing "Here is your icecream" multiple times?
@JafoorK3 ай бұрын
Could someone let me know what these are used for? Like what can you do with it that you cannot do some other way?
@johnneisler65524 ай бұрын
You are the best teacher ive ever had
@Diamond_Hanz4 ай бұрын
bro code is life
@Johnvids-g3oАй бұрын
I liked my own comment
@kallapallisai99594 ай бұрын
make a video on mongoDB plz sir
@BunrithViwatthanak4 ай бұрын
we now don't even use Alt + ; anymore because it doesn't work. Now we use Windows Key + .(period)
@vibingowsic23384 ай бұрын
Hey bro! How is it going? Hope you are doing well. In this comment I am going to ask you about Android development tutorial in java. Hi bro, I learned java from your tutorial. But there is a problem. When I got into android development, I got stuck. Can you please do a tutorial android with java.
@georgemouxios82483 ай бұрын
what happened to your old voice? change of mic? ( algorithm comment)