Computer >> Computer tutorials >  >> Programming >> Python

How to change all the function arguments to lowercase in Python?


The following code will convert the given function arguments to lowercase.

Example

#program to print lowercase of the list of function arguments
import inspect
def foo(ARG1, ARG2): pass
list1 = inspect.getargspec(foo)[0]
list1 =[item.lower() for item in list1]
 print list1

Output

['arg1', 'arg2']