結果 : how to write index function in python