Python args and kwargs Explained | *args and **kwargs

preview_player
Показать описание
In this video I explain how args and kwargs works in Python, and I also show you how to use them in your code. Args in Python is a great to make a function really durable, it allows for variable arguments or parameters in a function. Args acts like a list in a function. Kwargs in Python is a great way to have variable key and value argument in a function, which is basically a dictionary. Both args and kwargs are meant to make your code more efficient and versatile, so consider using them in your Python code.

Sources:
Рекомендации по теме
Комментарии
Автор

Great video and very simple to understand, if you could share the screen while running the code that will be much appreciated !

omaralaa
Автор

*args takes tuple as the arguments not a list. If u pass the list it will take the list as a tuple.

mmatvhindi
Автор

wtf man.. How can you be so clear explaining it? My biggest compliments to you! ♥

maybenew
Автор

Hey! Please Make more videos about Python. I'm pretty sure they will be helpful for people who want to learn programming because the way you explained staff is kinda of turning the context to easy understanding.

yuichadamon
Автор

Please do more of these! I couldnt wrap my head around this using my school's explanations, and you have just in 6 minutes explained what I couldnt crack in hours - please continue in these tutorials for Python!

jirih.
Автор

Really good, nailed it to perfection, you got a new subscriber

MohamedAhmed-rfbk
Автор

Been stuck on args and kwargs for two days, this video helped me out immensely. Thank you!

AnthonyFerrero
Автор

You should have shown your print statements. No reasons to have viewers imagining what this looks Ike.

JoeContrerasGenesisJoeC
Автор

Super easy to understand! THANK YOU!! this is the best explanation.

crimsonhawk
Автор

Thank you for the video. It really helped me understand *args and **kwargs as I was stuck with it for a couple of hours.

myrsineprimulaceae
Автор

Would’ve been nicer had you printed the output.

Danny-juyp
Автор

Thank you for the beautiful video, but why don't you show the print / output of your functions please?

mosama
Автор

simple, clean, and easy to understand!

suhuang
Автор

very simple and straight to the point, great explanation!

mohcench
Автор

Easy and clear explanation. Thanks a lot! :)

jimmg
Автор

This video is awesome; please post more video about Python..Thanks for sharing!

tjle
Автор

Great video and clear explanation! I just don't see a practical use for this? What is the advantage of those args against normal parameters?

twinwalks
Автор

If knowing a function makes one intermediate, then I am a pro. 🤣

wisdomovermoney
Автор

Your example with the list of car manufacturers is wrong. In arg_one(*args) the list passed in is seen as a single parameter and is placed in a tuple called args. The tuple contains one item; the list.

If you wanted to pass a list to a function, just use arg and not *arg.

gedtoon
Автор

how do we return an *args back to main from the function?

mohammedsameer