Change array to tuple

Change possible_levels to a tuple.  Arrays are mutable,
but we never want to mutate this value, so changing it
to a tuple reduces the risk of accidentally mutating it.

Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
This commit is contained in:
David A. Wheeler 2017-09-23 20:41:45 -04:00
parent 6f513af900
commit 4d589859dc
1 changed files with 2 additions and 1 deletions

View File

@ -2013,7 +2013,8 @@ def show_final_results():
count = 0
count_per_level = {}
count_per_level_and_up = {}
possible_levels = [0, 1, 2, 3, 4, 5] # Eliminate dependency on range
# Name levels directly, to avoid Python "range" (a Python 2/3 difference)
possible_levels = (0, 1, 2, 3, 4, 5)
for i in possible_levels: # Initialize count_per_level
count_per_level[i] = 0
for i in possible_levels: # Initialize count_per_level