#34 Python Tutorial for Beginners | Types of Arguments in Python

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

Coupon: TELUSKO10 (10% Discount)

For More Queries WhatsApp or Call on : +919008963671

In this lecture, we are discussing types of arguments in python :
-- formal argument
-- actual argument

Actual arguments have 4 types:
1)position
2)keyword
3)default
4)variable length argument

Position argument:
-- During a function call, values passed through arguments should be in the order of parameters in the function definition. This is called positional arguments.
e.g
def person(name,age):
print(name)
print(age)
add(5,6)

keyword argument:
-- During a function call, values passed through arguments don’t need to be in the order of parameters in the function definition. Keyword arguments can achieve this.
-- All the keyword arguments should match the parameters in the function definition.
e.g
person(age=28,name='navin')

default argument:
-- Default arguments are values that are provided while defining functions.
-- The assignment operator = is used to assign a default value to the argument.
-- Default arguments become optional during the function calls.
-- If we provide a value to the default arguments during function calls, it overrides the default value.
-- The function can have any number of default arguments.
-- Default arguments should follow non-default arguments.

e.g
def person(name,age=28):
print(name)
print(age)
person('navin')

variable length argument:
-- if you want to pass multiple value in a function call we can use variable length argument
def sum(a,*b):
print(a)
print(b)
c=a
for i in b:
c=c+i
print(c)

sum(5,6,34,78)

Subscribe to our other channel:
Telusko Hindi :

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

you are my first teacher in programming field and I have seen this whole playlist And right now I have deepest knowledge of python . thank you again. Guruji.

aakashtiwari
Автор

This works for variable length arguments:
def add(x, *y):
c = x+sum(y)
print(c)
add(5, 6, 7, 8)

vijayragav
Автор

sir, you have a good teaching skills and good knowledge as well, many people make their videos on internet but if we want to learn something from them, we need to pay money but u r awesome sir for providing us better knowledge which is free of cost , Thank u sir for providing us this wonderful opportunity , many of my friends are big fans of u sir, thanking u sir for being with us

venkatmaddirala
Автор

you just removed a huge amount of pressure I was feeling when I saw my prof using default variables out of nowhere. I felt lost till now. Thanks!

MrCEO-jwvm
Автор

7:30 wow you are making errors just to make the concept more clear, you are great sir.

vvsrakesh
Автор

never understood a single thing about functions from my school teacher in about 3 monthd but here in just one go i am crystal clear

prathampandey
Автор

Note:All required parameters must be placed before any default arguments

fireworks
Автор

Sir you are great trainer, I have gone through previous 35 videos of this playlist. Kindly guide to beginners about practicing python on projects. As you said in one of your previous video that listening and seeing videos is very easy, I want some guidance about practicing python by beginners.

rehanbaig
Автор

I am watching this tutorial again after a long time almost 4 years😊 It comes in my recommendation and I started watching this to revise my old days.
Your videos are great and helped me a lot. Thanks ❤

anAlokDubey
Автор

In 2024 also the best Python Tutorial 😊

Durga_Naveen
Автор

I just got the random recommendation of this video I just hypnotized during watching the video .. what an amazing teaching style he has .. love u, sir ..!!

grabit
Автор

I am really enjoying the series because of your good teachings

_ritesh
Автор

Thank you so very much for this. I got stuck on the concept of keyword arguments on another tutorial, and luckily I found your channel with this video. Turns out it's extremely simple once you get someone who can actually explain the stuff properly. Thank you!

tobiasrasmussen
Автор

Thank you very much. You are a genius.

vakhariyajay
Автор

in this you can pass 2 value or more and can try for user input
def sum (a, *b):
c=a
if len(b)<2:
print(a+b[0])

else:
for i in b:
c=c+i
print(c)


sum(5, 4, 5, 4, 6)

chiragukey
Автор

Sir its a blessing to have a teacher like u on youtube thanks a ton

sutirthabrahmachari
Автор

The way u r teaching sir is so simple and easy to grasp. Very thanks for this. ✌️

nishpandya
Автор

We can also write like this sir
def sum (a, b=[6, 7, 8]):
c = a+ b[0]+b[1]+b[2]
print (c)
sum (a=5)


O/p:
26

nvishnusai
Автор

He is a real teacher as well as a coder...he could have just deleted the scenes where he got errors, but he kept them to show us that, what type of problems we can get.

anikchowdhury
Автор

sir, you have a good teaching skills and good knowledge as well, THANK

zakiasmaa