ported python3

change x range to range