how to take list as command line arguments in python

Solutions on MaxInterview for how to take list as command line arguments in python by the best coders in the world

showing results for - "how to take list as command line arguments in python"
Miranda
03 Apr 2019
1>>> input = "[2,3,4,5]"
2>>> map(float, input.strip('[]').split(','))
3[2.0, 3.0, 4.0, 5.0]
4>>> A = map(float, input.strip('[]').split(','))
5>>> print(A, type(A))
6([2.0, 3.0, 4.0, 5.0], <type 'list'>)
7