aboutsummaryrefslogtreecommitdiff
path: root/tanken.py
diff options
context:
space:
mode:
Diffstat (limited to 'tanken.py')
-rw-r--r--tanken.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tanken.py b/tanken.py
index a9468b0..2ca80bd 100644
--- a/tanken.py
+++ b/tanken.py
@@ -23,6 +23,8 @@ def tanken(drives, cost):
passengers[p][0] += d[0]
# calculate cost per kilometer
+ if distance <= 0:
+ return None, "Driven distance must be greater than 0!"
c = cost/distance
for d in drives: