#35 Python Tutorial for Beginners | Keyworded Variable Length Arguments in Python | **kwargs

preview_player
Показать описание
Check out our courses:

Coupon: TELUSKO10 (10% Discount)

Coupon: TELUSKO10 (10% Discount)

Coupon: TELUSKO20 (20% Discount)

Udemy Courses:

For More Queries WhatsApp or Call on : +919008963671

In this lecture we will discussing Kwargs:
-- Keyword variable length argument
-- we have talk about variable length argument in previous chapter

Variable length argument :
-- A variable-length argument is a feature that allows a function to accept an arbitrary number of arguments.
The syntax for defining a variable-length argument in Python is to use an asterisk (*) before the parameter name.
e.g
def person(name,*data):
print(name)
print(data)
person('navin',28,9765432)

keyword variable length argument:
-- keyword variable length argument is a feature that allows a function to accept an arbitrary number of keyword arguments.
-- use a double asterisk (**) to define a variable-length argument that accepts keyword arguments. For example:
-- the **kwargs parameter allows the function to accept an arbitrary number of keyword arguments. The function can then loop over the dictionary of keyword arguments and do something with them.

e.g
def person(name,**data): #**kwargs
print(name)
for i, j in data:
print(i,j) #i is key and j is value
person('navin',aget=28,city='Mumbai',mob=9865432)

Python Tutorial to learn Python programming with examples

Editing Monitors :

Subscribe to our other channel:
Telusko Hindi :

Donation:
PayPal Id : navinreddy20
Patreon : navinreddy20
Рекомендации по теме
Комментарии
Автор

Telusko learning deserve diamond sheet button ( 10M ) subscribers for such kind of great valuable work best education & motivation & guidance & support & help.
❤ from abhishek sethi Jaipur rajasthan.

abhisheksethi.
Автор

Why use " data.items() "
> because in 3:35(video_timestamp) if you look at the output you'll see that the "data" is shown in {curly-brackets} and also it has a unique keyword when we call this function which means we can say that the "data" is a dictionary and to access each elements inside the dictionary we use .items() function .
you can try it if you want:
1)make a dictionary
2)and apply for loop as telusko did in 4:13(video_timestamp) in your program
and see yourself finished learning this topic :)

tempmail
Автор

Hey,
Nice video series Navin.
You might be surprised to know, I was your senior in the college and glad you have explained this series in a way that anyone from other programming language background can easily understand.

NinadNagwekar
Автор

I m mechanical background N I started to learn python.
I searched lot of videos, trust me u r the best lecturer.
Thank you so much sir. Keep going

parameshwarsuguri
Автор

I just love the introductory part in your every video. And of-course the lectures are awesome.

thebunerikhan
Автор

OH MY GOSH FINALLY. A tutorial that creates an actual example. Everyone and their dog uses generic BS, creating *args and *kwargs NAMED *args and *kwargs and producing the 90th 'foo' argument I've seen today. -_- This is the first tutorial in a big pile of them that actually made any attempt at an _application_ of this structure. You're a hero, sir. Thank you.

aghasttoadgaming
Автор

You are brilliant. You earned a subscriber.

Adks
Автор

Way better than regular class lectures, finally loving Python
thanks

godwin
Автор

With * you get a tuple as the output so if the user input comes with a keyword it will give an error.
but with ** you get a dictionary as the output, so if the user input comes without a keyword it will give an error.

WOW, this is the first time we came across using a for loop to a dictionary.
Thank you, Navin, for all your great service.

Rajadahana
Автор

Finally found a video that explains kwargs in an understandable way! Thank you!

corbettknoff
Автор

Very lucky to have you as a guide when I decide to learn python. Thank you very much.

rotrose
Автор

Thank you. this was breif, clear and to the point. Christ i wasted so much time listening to other tutorials that never gave me any straight answers

DoraKage
Автор

After watching several videos on this, I have to say yours is the one that enabled me to understand. Thank you!

kychemclass
Автор

I'm not getting bored because of your excellent explanation 😉

animerule
Автор

Every video content is fully satisfying. Highly recommended for all python learners.

pranav
Автор

Thank you man! It seems to me that you are born to teach. My compliments!

giuseppepala
Автор

i will complete these playlist soon i will be consistent now and practise daily

sufiyanmogal
Автор

Navin Reddy Sir is our hero! ♥ love from Kolkata...

soumadip_banerjee
Автор

Thanks for your vid! You make it as simple as you can to make beginners like me understand how to code with python!

intheatmosphere
Автор

You are such a great teacher. I salute u sir.

devintaspharma