Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

list arguments of function python

>>> func = lambda x, y: (x, y)
>>> 
>>> func.__code__.co_argcount
2
>>> func.__code__.co_varnames
('x', 'y')
>>>
>>> def func2(x,y=3):
...  print(func2.__code__.co_varnames)
...  pass # Other things
... 
>>> func2(3,3)
('x', 'y')
>>> 
>>> func2.__defaults__
(3,)
Comment

PREVIOUS NEXT
Code Example
Python :: python string caps lock 
Python :: list input python 
Python :: how to find duplicates in pandas 
Python :: how to create a for loop in python 
Python :: how to use pyplot 
Python :: python bool() 
Python :: pyton for 
Python :: leetcode solutions python 
Python :: str in python 
Python :: if statements python 
Python :: how to add virtual environment in vscode 
Python :: python ValueError: zero-size array to reduction operation maximum which has no identity 
Python :: python check if character in string 
Python :: list python 
Python :: where python packages are installed 
Python :: Matching a pattern in python 
Python :: numpy indexing 
Python :: how to create a subset of a dataframe in python 
Python :: joining two lists in python using for loop 
Python :: vstack numpy 
Python :: step function 
Python :: how to slice string in python 
Python :: Math Module floor() Function in python 
Python :: is python idle an ide 
Python :: NEW CALENDAR MODULE 
Python :: django model registration 
Python :: matplotlib cheat sheet 
Python :: how to represent equation in pytho 
Python :: sklearn euclidean distance 
Python :: python iterate over instances of class 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =