power函数
from math import pow def power(x, y): if y == 0: return 1 tot = 1 for i in range(y): tot *= x return tot if __name__ == '__main__': for x in range(5): for y in range(5): print('Pow(x, y): ', x, y, int(pow(x, y))) print('Power(x, y): ', x, y, power(x, y))