filmov
tv
Python - Function Argument Unpacking
Показать описание
Python - Function Argument Unpacking
in python function argument unpacking is done by * and ** operator while calling function.
Examples:
Function Argument Unpacking
def func(a,b):
print(f"{a},{b}")
func(1,2)
list1=[1,2]
func(list1)
func(*list1)
tuple1=(10,20)
func(*tuple1)
exp = (x * x for x in range (1,3))
func(*exp)
def func(a,b):
print(f"{a},{b}")
new_dic = {'a':1,'b':2}
func(**new_dic)
func(*new_dic)
============================================================================= Link for Tutorial Series
Jupyter Notebook Tutorial Series:-
Python Tutorial Series:-
Python Assignments and Objective Questions:-
============================================================================= Feel free to connect and ask your queries:-
============================================================================= Show your support by Subscribing to the channel:-
=============================================================================
#ParagDhawan
#PythonCrashCourse
#Python
#PythonTutorialForBeginners
#PythonForDataScience
#PythonProgramming
#PythonProgrammingLanguage
#PythonTutorial
#PythonCode
#Python3
=============================================================================
Note: Watch the video at a speed of 1.5
in python function argument unpacking is done by * and ** operator while calling function.
Examples:
Function Argument Unpacking
def func(a,b):
print(f"{a},{b}")
func(1,2)
list1=[1,2]
func(list1)
func(*list1)
tuple1=(10,20)
func(*tuple1)
exp = (x * x for x in range (1,3))
func(*exp)
def func(a,b):
print(f"{a},{b}")
new_dic = {'a':1,'b':2}
func(**new_dic)
func(*new_dic)
============================================================================= Link for Tutorial Series
Jupyter Notebook Tutorial Series:-
Python Tutorial Series:-
Python Assignments and Objective Questions:-
============================================================================= Feel free to connect and ask your queries:-
============================================================================= Show your support by Subscribing to the channel:-
=============================================================================
#ParagDhawan
#PythonCrashCourse
#Python
#PythonTutorialForBeginners
#PythonForDataScience
#PythonProgramming
#PythonProgrammingLanguage
#PythonTutorial
#PythonCode
#Python3
=============================================================================
Note: Watch the video at a speed of 1.5
Комментарии