Implement p0 tutorial.

This commit is contained in:
2021-10-11 21:01:31 -04:00
parent a95016431f
commit cd948fe640
15 changed files with 165 additions and 159 deletions

View File

@@ -78,7 +78,7 @@ class Town:
if not route:
return 0
totalDistance = self.getDistance('home', route[0])
for i in xrange(len(route) - 1):
for i in range(len(route) - 1):
totalDistance += self.getDistance(route[i], route[i+1])
totalDistance += self.getDistance(route[-1], 'home')
return totalDistance