I do not really understand what you mean, but I'll try to explain.
How can i write a python function that prints out the requested index position in a list?
This is very easy, you are actually really close to the solution:
def index_position(my_list, index):
a = my_list[index]
print(a)
This will surelly work by printing the element at the given index (unless its out of bounds for the list)
As for this:
Here I expect the argument to print out the index position of an element of a list list when the function is called.
I understand that you want something like a getIndexOf method, that returns the index of an element that you are passing, this could be done like this:
def index_position(my_list, index):
counter = 0;
for i in my_list:
if(i == index):
print(counter)
return
counter += 1
This will print the the element at the position on the list.