N = 1 #Initialized at 1 because it counts the number of returns : "\n", if there is only 1 waypoint it would be outputting 0 for i in waypoints_text: #Counts the number of waypoints waypoint = ...