Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python parameter pack

# A Python program to demonstrate both packing and
# unpacking.
 
# A sample python function that takes three arguments
# and prints them
def fun1(a, b, c):
    print(a, b, c)
 
# Another sample function.
# This is an example of PACKING. All arguments passed
# to fun2 are packed into tuple *args.
def fun2(*args):
 
    # Convert args tuple to a list so we can modify it
    args = list(args)
 
    # Modifying args
    args[0] = 'Geeksforgeeks'
    args[1] = 'awesome'
 
    # UNPACKING args and calling fun1()
    fun1(*args)
 
# Driver code
fun2('Hello', 'beautiful', 'world!')
Comment

PREVIOUS NEXT
Code Example
Python :: Filter xarray (dataarray) 
Python :: 2d arrary.push in python 
Python :: python download from digital ocean spaces boto3 
Python :: or without file pythonmodules.txt 
Python :: converting from series to dataframe with tabulate 
Python :: how to app object pyhthon 
Python :: fungsi untuk mengecek apakah ada data yang kosong 
Python :: print all data in excel openpyxl 
Python :: ipython run script with command line arguments 
Python :: Command raised an exception: TypeError: discord.py 
Python :: cython could not creat pyd file no such file or directory 
Python :: dependency parser tags 
Python :: series clip 
Python :: python scale function 
Python :: what is certifi module in python 
Python :: repalce na with mean per group 
Python :: readme python convert to pdf 
Python :: yamaha palhetas 
Python :: python: dunder init method 
Python :: cbv uk django 
Python :: dict_leys to list 
Python :: how to select the shortest item in a python list 
Python :: fibonacci series program in python 
Python :: duplicate characters in a string python 
Python :: python using string to access objects 
Python :: how to call a specific item from a list python 
Python :: remove punctuation and special charaacters nltk 
Python :: django nested inlines 
Python :: iterate rows 
Python :: remove duplicate rows in pandas 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =