I tried to make a simple program using python that take custom input from user and it would used into a list which have a input format like this.
$ python name_app.py
$ <method> <position_index> <value>
i have tried some thing like this.
lst = []
n = input().split()
print(n[0])
test = lst.n[0](n[1], n[2])
print(test)
The sample input would be like:
$ python name_app.py
$ append 0 2
Well i thought the code would be like this if i pass the input
lst.append(0, 2)
But i got an error like below
File "app.py", line 5, in arr
test = lst.n[0](n[1], n[2])
AttributeError: 'list' object has no attribute 'n'
How could i make the user's input considered as "method" object and not a common attribute ?