Power Function In Python Using A Loop