diff --git a/scratch/crash_course_in_python.py b/scratch/crash_course_in_python.py index 71608d4a..f7238aff 100644 --- a/scratch/crash_course_in_python.py +++ b/scratch/crash_course_in_python.py @@ -146,14 +146,14 @@ def full_name(first = "What's-his-name", last = "Something"): assert x == [-1, 1, 2, 3, 4, 5, 6, 7, 8, 9] -first_three = x[:3] # [-1, 1, 2] +first_three = x[:3] # [0, 1, 2] three_to_end = x[3:] # [3, 4, ..., 9] one_to_four = x[1:5] # [1, 2, 3, 4] last_three = x[-3:] # [7, 8, 9] without_first_and_last = x[1:-1] # [1, 2, ..., 8] -copy_of_x = x[:] # [-1, 1, 2, ..., 9] +copy_of_x = x[:] # [0, 1, 2, ..., 9] -every_third = x[::3] # [-1, 3, 6, 9] +every_third = x[::3] # [0, 3, 6, 9] five_to_three = x[5:2:-1] # [5, 4, 3]