Python Finding Cube Using For Loop