In this paper, we import tensor index notation including Einstein summation notation into programming by introducing two kinds of functions, tensor functions and scalar functions. Tensor functions are functions that contract the tensors given as an argument, and scalar functions are the others. As with ordinary functions, when a tensor function obtains a tensor as an argument, the tensor function treats the tensor as it is as a tensor. On the other hand, when a scalar function obtains a tensor as an argument, the scalar function is applied to each component of the tensor. This paper shows that, by introducing these two kinds of functions, index notation can be imported into whole programming, that means we can use index notation for arbitrary functions, without requiring annoying description to enable each function to handle tensors. This method can be applied to arbitrary programming languages.