check if last item in for loop python