O6: telemetry report and eval task set (#14)
This commit was merged in pull request #14.
This commit is contained in:
1 parent
bea07e82bb
commit
b2d72f2dc9
31 files changed
+809
-3
No files matched your search
@@ -0,0 +1,2 @@
|
||||
def last_n(xs, n):
|
||||
return xs[len(xs) - n + 1:]
|
||||
@@ -0,0 +1,6 @@
|
||||
from lib import last_n
|
||||
|
||||
assert last_n([1, 2, 3, 4], 2) == [3, 4]
|
||||
assert last_n([1, 2, 3], 3) == [1, 2, 3]
|
||||
assert last_n([1], 1) == [1]
|
||||
print('ok')
|
||||
@@ -0,0 +1 @@
|
||||
python3 test_lib.py
|
||||
@@ -0,0 +1,2 @@
|
||||
def last_n(xs, n):
|
||||
return xs[len(xs) - n:]
|
||||
@@ -0,0 +1,3 @@
|
||||
# Fix the off-by-one in last_n
|
||||
|
||||
`last_n(xs, n)` in `lib.py` must return the last n items of the list, but it returns one too few. Fix it. Do not change the tests.
|
||||
Reference in new issue
Block a user