# -*- coding:utf-8 -*-classSolution:defPower(self, base, exponent):if base ==0and exponent >0:return0if base ==0and exponent <=0:returnFalseif base !=0and exponent >0:return base ** exponent
if base !=0and exponent ==0:return1if base !=0and exponent <0:return1/(base **(-exponent))