Python Tutorials - Decorators Part 1 | Introduction | Functions | Example

  Рет қаралды 75,142

Amulya's Academy

Amulya's Academy

Күн бұрын

Пікірлер: 144
@nishchalchandrajwar4885
@nishchalchandrajwar4885 5 жыл бұрын
Best python lectures in KZbin.... You nailed it.. Thankuu...
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Thank you :)
@nikhilhaspe2734
@nikhilhaspe2734 4 жыл бұрын
Did you check Telusko's one?
@umaranjan4481
@umaranjan4481 4 жыл бұрын
Better than any python tutorial on you tube....
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thank you :)
@TheJeromeDominic
@TheJeromeDominic 4 жыл бұрын
Hands down the best Python Tutor on KZbin..Wow..thanks a millon..!!!..I'm doing a paid online course and I'm here as I couldn't understand certain concepts explained in the course by a highly experienced tutor..and I think, no one could explain and teach decorators better than what you have done here..thank u..a lot of respect..
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thank you :)
@sathishdarshanala6137
@sathishdarshanala6137 3 жыл бұрын
amulya thnks for explaining decorators u r the best teacher
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you so much :)
@aparajitakumari2936
@aparajitakumari2936 3 жыл бұрын
Thanks. For the last two days, I watched a lot of videos on decorators. I could not understand. Then I watched your videos on variable scope, legb rule, closure and then decorators. You explained everything so easily. Thank you so much.
@sunnyjain630
@sunnyjain630 Жыл бұрын
Finally I got the concepts of Decorators. Thanks❤️
@shikhaverma8375
@shikhaverma8375 2 жыл бұрын
It's superb video mam and your way of teaching is very nice and all the viewers who watch your video are also clear your all the concept from your video and I insist you all please wait this video it's very clear and point to point
@taiwanSmart
@taiwanSmart 4 жыл бұрын
you are so intelligent, not only good at coding, but also good at teaching, thank you!
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thank you :)
@akankshavijayvergiya1431
@akankshavijayvergiya1431 5 жыл бұрын
this is probably the best video .explained in detailed manner
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Pleasure :)
@Snake_Fire0
@Snake_Fire0 4 жыл бұрын
You are the Best teacher.
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thank you! 😃
@Prajwal_KV
@Prajwal_KV 4 жыл бұрын
Amulya Thanks a lot .After watching a ample videos from other youtube channels finally your video cleared the concepts vividly.
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
You are most welcome :)
@balakrishnavaidyanathan8572
@balakrishnavaidyanathan8572 4 жыл бұрын
Amulya's academy python videos are best.i really appreciate your videos
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Glad to hear that :)
@balakrishnavaidyanathan8572
@balakrishnavaidyanathan8572 4 жыл бұрын
Which year you started python programming.we can easily understand your videos
@balakrishnavaidyanathan8572
@balakrishnavaidyanathan8572 4 жыл бұрын
I am learning a lot from amulya's academy about python
@satyajitdas2780
@satyajitdas2780 5 жыл бұрын
Hi, Amulya. The decorator concept was superb and perfect, you have presented in a very simplified way, really liked it, waiting for next videos on the same topic, as I got interest in this. Thanks
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Thank you :) I will upload it soon :)
@naveenkumarkaranam3612
@naveenkumarkaranam3612 2 жыл бұрын
Your teaching is simply super
@mayuridas5161
@mayuridas5161 4 жыл бұрын
You are awesome in explaining .please do continue this .You are doing a lot of people a big help. And yeah finally decorator concept was so beautifully and easily explained....really very helpful..😊
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thank you so much!
@sardarahmed5174
@sardarahmed5174 5 жыл бұрын
I have taken Python basics course for $350 on Edureka & then I took Python for data science course with Edureka for $800Later I took few more courses on udemy for Python.All I can say is Amulya tutorials on Pythons are the best so far and all that for free, awesome.Amulya, 200+ videos on Python, kudos.One suggestion, now that you have shown so many things in Python can you please show us a few real time projects using all these concepts so we can out things together.In bits and pieces, we know how classes, methods, decorators, functions, recursive functions, shelves etc work but it will be great to see them put in real action.Do you offer any python training on how to build real time projects, I would love to take the training
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Thank you so much :) I will work on your suggestion. I will make videos on projects, but currently i need to cover other basic concepts. Sorry :)
@noblessetech
@noblessetech 5 жыл бұрын
your voice is very pleasing to ear..!
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Thank you :)
@rajeshvenkatsubbu5350
@rajeshvenkatsubbu5350 4 жыл бұрын
the way you explained is really awesome...
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thank you :)
@sowndharya183
@sowndharya183 5 жыл бұрын
Explaining clearly and easy to understand.. Superbb
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Thank you :)
@richluetoure3683
@richluetoure3683 5 жыл бұрын
Amuls is the best.
@haribhaskar72
@haribhaskar72 6 ай бұрын
Thanks for this Video, you explained decorator function very well. God bless you...
@venkatraj608
@venkatraj608 3 жыл бұрын
Madam very nice explanation and pronouns I search your Chanel bottom of line good keep top
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you 😊
@sureshreddy3773
@sureshreddy3773 3 жыл бұрын
Big fan of ur content and voice ❤️
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you 😊
@entirebentirec3296
@entirebentirec3296 4 жыл бұрын
Divide by Zero simpler version: def decor_div(func): def inner(x,y): if y==0: return "number cannot be dived by zero,give proper input" else: return func(x,y) return inner def div(a,b): return a/b d=decor_div(div) print(d(8,0))
@drsmahesan203
@drsmahesan203 3 жыл бұрын
Yes, but setting decorator is equivalent to redefining div as div = decor_div(div)
@DaniruDEV
@DaniruDEV 3 жыл бұрын
I stucked at decorators thanks for changing it
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Glad to hear that :)
@vijayaramaraju2856
@vijayaramaraju2856 2 жыл бұрын
Your explanation is really good
@souravdeb3613
@souravdeb3613 4 жыл бұрын
excellent..consolidated each and every concept in a single space..request to continue making videos on different topics in python
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thank you :)
@natsudragneel8305
@natsudragneel8305 4 жыл бұрын
best tutorial for decorator
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thank you :)
@rajeshh2792
@rajeshh2792 4 жыл бұрын
Good Tutorial Amulya.
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thank you :)
@bunnyvlogs7647
@bunnyvlogs7647 4 жыл бұрын
hi mam....best explanation...................... can u help on same with singleton class from scratch
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Will try :)
@PRADEEP_SUNKARI
@PRADEEP_SUNKARI 5 жыл бұрын
Hi Amulya .I am new subscriber to ur channel.your explanation is very good .
@siddharthashaw9766
@siddharthashaw9766 Ай бұрын
best best
@AmulsAcademy
@AmulsAcademy Ай бұрын
Thaak you :)
@anuradhakumari6123
@anuradhakumari6123 2 жыл бұрын
Thanks a lot. Very well explained thr concept
@chetanmazumder310
@chetanmazumder310 4 жыл бұрын
Mam , you are awesome !!!
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thanks a lot 😊
@BabatopeFagbenle-rk6jy
@BabatopeFagbenle-rk6jy Күн бұрын
❤🎉 thanks for the enlightenment
@entirebentirec3296
@entirebentirec3296 4 жыл бұрын
This can be simpler as : def str_upper(func): str1=func() x= str1.upper() return x def print_str(): return "Good Morning" print(print_str()) d=str_upper(print_str) print(d)
@jagadeeshbusani606
@jagadeeshbusani606 5 жыл бұрын
Great video on decorator. Looking forward for more like this!!! Thanks.
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Thank you :)
@harik1999
@harik1999 5 жыл бұрын
Nice video with clear explanation and easy to understand the concepts from you as always!!! One more request ma'am : I have gone through the series of your videos and couldn't able to find out the deep and shallow copy videos. Could you please make one video with regards to that ?
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Thank you :) Sure i will make deep and shallow copy videos asap :)
@drsmahesan203
@drsmahesan203 3 жыл бұрын
@15:01+ Setting decorator is equivalent to having a statement that redefines the function to be decorated as, for example, print_str = str_upper(print_str) :-) Similarly @19:00+ div = div_decorator(div) instead of decorating with @div_decorator :-)
@globalgrowth343
@globalgrowth343 2 жыл бұрын
Thanks, But I like the way you say "now"
@ankitgupta-wz3oj
@ankitgupta-wz3oj 2 жыл бұрын
Very helpful session. Thanks a lot
@sanketsuryawanshi
@sanketsuryawanshi 4 жыл бұрын
Great Explanation Ever I Seen !! 👍🔥
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Glad to hear that! :)
@philipberthiaume2314
@philipberthiaume2314 3 жыл бұрын
Brilliant, thank you...
@shruthik7278
@shruthik7278 2 жыл бұрын
Too good mam thank you so much
@sivasankar7195
@sivasankar7195 5 жыл бұрын
Hi, This was a wonderful explanation on Decorators. i've a doubt at 18:30, why should we give as (return "give proper input), instead of return statement can we give print statement
@meralmaradia4774
@meralmaradia4774 3 жыл бұрын
Great !! You deserve more subscribers (y)
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you 😊
@drsmahesan203
@drsmahesan203 3 жыл бұрын
If she appears once in a while, it may happen :-))
@BS-eu9do
@BS-eu9do 4 жыл бұрын
I couldn't understand that why do we use inner function.. Because We can directly call the function which is to be decorated without using inner function... So, could you tell me the requirement of the inner function... 14:18
@vidyasagarreddy3668
@vidyasagarreddy3668 4 жыл бұрын
You Can call and return upper string without defining another inner method , She is just showing example, because it is decorator will use concept of closure, Python Decorators make an extensive use of closures as well. Go through this link www.programiz.com/python-programming/closure Also when you use @function_name, it does not work without inner function defined
@smenezes5359
@smenezes5359 4 жыл бұрын
You don't need inner in this example - and her explanation for the inner at 20.23 is inaccurate imho. Closure is one reason [as pointed above] but I've found that you do need the inner function when you pass args and kwargs. The outer function will be given the name of the function being decorated and the inner wrapper will be passed the args. [ I'm new to this also, so feel free to challenge]
@natsudragneel8305
@natsudragneel8305 4 жыл бұрын
Thankyou so much
@jagadeeshbusani606
@jagadeeshbusani606 5 жыл бұрын
Can pls make a detailed video on Generators as well...
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
ok :)
@prasadpathak3209
@prasadpathak3209 4 жыл бұрын
Hey Amulya what about if I have multiple nested functions what should it work
@kartikchakraborty5511
@kartikchakraborty5511 5 жыл бұрын
Very helpful .. thanks you..
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
My pleasure :)
@bharatm9727
@bharatm9727 5 жыл бұрын
Can you start python - selenium
@ibrahimali-xd3bw
@ibrahimali-xd3bw 3 жыл бұрын
Hi, Amulya. Great explanation. in your second example i get this error (div() missing 2 required positional arguments: 'a' and 'b') if the denominator is not 0 , eg div(4, 2), please help on this.
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Give me the program please :)
@ibrahimali-xd3bw
@ibrahimali-xd3bw 3 жыл бұрын
@@AmulsAcademy working fine now , but I don't know what happened!!! Thanks
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Ok :)
@vikaskale5640
@vikaskale5640 3 жыл бұрын
Mam make more videos on python
@sujitdas5745
@sujitdas5745 5 жыл бұрын
Your videos are very helpful for me.But now our college start "GNU octave" coding so can you help me?????
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Now i can't start sorry :)
@sujitdas5745
@sujitdas5745 5 жыл бұрын
Please mention some books for GNU octave and Python...
@himabindugandikota4526
@himabindugandikota4526 4 жыл бұрын
when we write inner as a function i.e inner() we just need change in the undecorated function as print(str_upper) in the first example then what about the second example i.e def div(a,b)
@sayanjitb
@sayanjitb 3 жыл бұрын
def str_upper(func): def inner(): str1=func() return str1.upper() return inner() def print_str(): return "good morning" print(print_str()) str_upper(print_str) ---------------------------------------------- dear ma'am, can you please help me whether this code is right or wrong?
@sayanjitb
@sayanjitb 3 жыл бұрын
Dear ma'am, I also checked the following program also worked, here I have not used nested function nevertheless it works as expected. def str_upper(func): str1=func() return str1.upper() @str_upper def print_str(): return "good morning" print(print_str) output: GOOD MORNING
@debojitmandal8670
@debojitmandal8670 3 жыл бұрын
Mam can you atlesast send me a link or tell me from where I can practice decorators problems. Please I want more questions on decorators to practice
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
I will check :)
@waleedislam3280
@waleedislam3280 4 жыл бұрын
EXCELLENT
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thank you :)
@tsa_vibes
@tsa_vibes 2 жыл бұрын
17:38, how did the function inner (x, y) was assign the value of div(a, b) , x=a, y=b.. ?
@asurya
@asurya 4 жыл бұрын
15:00 Instead of writing inner function we can directly str1.upper() in str_upper function itself right? then why are we using inner function
@amitunemelody5612
@amitunemelody5612 4 жыл бұрын
yes you can do it and the output will also come the same.But this thing can't be called as a decorator. For decorator, the closure property must be satisfied which say's that, to use the closure, we must have a nested function. That's why their is an inner nested function
@drsmahesan203
@drsmahesan203 3 жыл бұрын
Here the purpose is not making the string uppercase. It was taken as an example to explain decorator. A better, practically needed example could have been also added.
@alinisar2553
@alinisar2553 4 жыл бұрын
what is the purpose of Nested function i.e (inner()) inside the decorator function?
@jchakrab
@jchakrab 4 жыл бұрын
why can't outer itself return str1.upper()..why inner is needed ? can u please explain...
@anuppradhan6876
@anuppradhan6876 2 жыл бұрын
if we want to modify a function later we can modify it later without using decorators also. Then why do we use decorators??
@SapnaGupta-vv5fr
@SapnaGupta-vv5fr 5 жыл бұрын
satisying explanation like it
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Thank you :)
@shaikbyte
@shaikbyte 4 жыл бұрын
may god give the understandable capacity, who disliked this video...
@janakiyeluripati6368
@janakiyeluripati6368 4 жыл бұрын
Hello Madam, can you help me how to do this problem using decorators. I want to add three integers a,b,c and return their sum except if the numbers are between 21 to 29 i would like to count them as zero and return the sum of the other integers. how to do this?
@tanujtiwari8581
@tanujtiwari8581 2 жыл бұрын
hii , if we can change the lower case letters to upper with single function then why you use nested function in this case.
@madhuyagadasu7474
@madhuyagadasu7474 2 жыл бұрын
same doubt @amulya's academy
@sankethb.k642
@sankethb.k642 5 жыл бұрын
Thanks a lot mam
@pankajsingh6925
@pankajsingh6925 3 жыл бұрын
Hello ma'am, if you have any full fledge python project as a paid course do let me know...
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Ok 😊
@sowndharya183
@sowndharya183 5 жыл бұрын
New subscriber 😊
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Thank you :)
@bharatruttala7187
@bharatruttala7187 2 жыл бұрын
Thanks a lottttttt
@amrithpurandhar9882
@amrithpurandhar9882 3 жыл бұрын
how are x,y related to a,b
@mohitdhiman7230
@mohitdhiman7230 5 жыл бұрын
in first example you return the inner function first after that return strupdate,but in second example you return inner function in last.why?
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Give me the video timing please :)
@mohitdhiman7230
@mohitdhiman7230 5 жыл бұрын
@@AmulsAcademy 6:42 and 13:57
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
In both example i returned inner at last. :)
@mohitdhiman7230
@mohitdhiman7230 5 жыл бұрын
@@AmulsAcademy 😁got it..... thnx
@ainasrhmn
@ainasrhmn Ай бұрын
tnx
@shamanr897
@shamanr897 4 жыл бұрын
6:58 you can here a rooster crowing in the background (0_o)
@lakhanbabar9440
@lakhanbabar9440 3 жыл бұрын
😂😂😂😂 yes bro
@zizo8737
@zizo8737 5 жыл бұрын
I can’t understand 😭
@srikarveeravatnam3267
@srikarveeravatnam3267 Жыл бұрын
GOOD at explaining ....by the way i didin't receive any watch😉
@calliart6586
@calliart6586 4 жыл бұрын
Damn.. tricky
@kkmahapatra8538
@kkmahapatra8538 4 жыл бұрын
I can't get it properly........
@omenechris4698
@omenechris4698 2 жыл бұрын
Jesus! Woman I bow!
@felipica
@felipica 2 жыл бұрын
ajudou mt mano slk valeu
5 жыл бұрын
lots of "OKEY?" ma'm...
@soham19902008
@soham19902008 5 жыл бұрын
Hi Amul, Your presentation and voice,both are great. Can you please share your mail id, so that I may ask you about few doubts which I need to clarify. Thank You
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Thank you :) amulsacademy@gmail.com you can ask your queries in our fb page also. :)
@munivoltarc
@munivoltarc Жыл бұрын
don't use repeatedly the word 'right' okay, it is not impressive in your explanation
@janakiyeluripati6368
@janakiyeluripati6368 4 жыл бұрын
Hello Madam, can you help me how to do this problem using decorators. I want to add three integers a,b,c and return their sum except if the numbers are between 21 to 29 i would like to count them as zero and return the sum of the other integers. how to do this?
Python Tutorials - Closure | Nested Functions
11:40
Amulya's Academy
Рет қаралды 44 М.
Hoodie gets wicked makeover! 😲
00:47
Justin Flom
Рет қаралды 94 МЛН
My MEAN sister annoys me! 😡 Use this gadget #hack
00:24
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 6 МЛН
Python Decorators in 15 Minutes
15:14
Kite
Рет қаралды 450 М.
Python Tutorials - Property Decorators Part 2 | Properties
16:13
Amulya's Academy
Рет қаралды 14 М.
PLEASE Use These 5 Python Decorators
20:12
Tech With Tim
Рет қаралды 120 М.
25 nooby Python habits you need to ditch
9:12
mCoding
Рет қаралды 1,8 МЛН
Python Tutorials - Property Decorators Part 1
16:42
Amulya's Academy
Рет қаралды 31 М.
Hoodie gets wicked makeover! 😲
00:47
Justin Flom
Рет қаралды 94 МЛН