Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Function argument unpacking in python

def myfunc(x, y, z):
    print(x, y, z)

tuple_vec = (1, 0, 1)
dict_vec = {'x': 1, 'y': 0, 'z': 1}

myfunc(*tuple_vec)

# Output
# 1, 0, 1

myfunc(**dict_vec)

# Output
# 1, 0, 1
Comment

PREVIOUS NEXT
Code Example
Python :: set_debug 
Python :: Send Variable Over In Python Views 
Python :: Get Results From Table Django 
Python :: Uploading small amounts of data into memory 
Python :: NAME.append (Line.split(",")[1].rstrip()) IndexError: list index out of range 
Python :: get database image in dajngo 
Python :: rename all files in a folder and subfolder 
Python :: first flask api 
Python :: Power Without BuiltIn Function 
Python :: linear plot 1D vector for x python 
Python :: commend in .env 
Python :: python using type and name advanced 
Python :: python Access both key and value without using items() 
Python :: cgi in python; get() method 
Python :: python solve rubicks cube 
Python :: webhook logger python 
Python :: heads or tails python 
Python :: is dictreader scoped in python 
Python :: cos2x 
Python :: strategy forex with python 
Python :: no lapack/blas resources found scipy 
Python :: flip a coin with array in python 
Python :: Show output of views in html using ajax, django 
Python :: getting month number in python 
Python :: admin email errors 
Python :: django models filter(x in list) 
Python :: Indices may also be negative numbers, to start counting from the right:Indices may also be negative numbers, to start counting from the right: 
Python :: to remove whitspace in string 
Python :: rickroll on input IN PYTHON 
Python :: web3.eth.personal.newAccount(password, [callback]) 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =