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

PythonServer Side ProgrammingProgramming

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']
raja
Published on 07-Dec-2017 16:42:48
Advertisements