7 kyu
Thinkful - List and Loop Drills: Inverse Slicer
3,003 of 4,457Grae-Drake
Description:
You're familiar with list slicing in Python and know, for example, that:
>>> ages = [12, 14, 63, 72, 55, 24]
>>> ages[2:4]
[63, 72]
>>> ages[2:]
[63, 72, 55, 24]
>>> ages[:3]
[12, 14, 63]
Write a function inverse_slice
that takes three arguments: a list items
, an integer a
and an integer b
. The function should return a new list with the slice specified by items[a:b]
excluded.
For example:
>>>inverse_slice([12, 14, 63, 72, 55, 24], 2, 4)
[12, 14, 55, 24]
Input domain:
items
will always be a valid sequence.b
will always be greater thana
.a
will always be greater than or equal to zero.a
will always be less than the length ofitems
.b
may be greater than the length ofitems
.
Fundamentals
Lists
Similar Kata:
Stats:
Created | Jan 5, 2017 |
Published | Jan 5, 2017 |
Warriors Trained | 5894 |
Total Skips | 86 |
Total Code Submissions | 10674 |
Total Times Completed | 4457 |
Python Completions | 3003 |
JavaScript Completions | 1138 |
CoffeeScript Completions | 14 |
Crystal Completions | 10 |
Ruby Completions | 115 |
PHP Completions | 156 |
Haskell Completions | 79 |
Rust Completions | 114 |
COBOL Completions | 5 |
Scala Completions | 10 |
Total Stars | 52 |
% of votes with a positive feedback rating | 92% of 601 |
Total "Very Satisfied" Votes | 516 |
Total "Somewhat Satisfied" Votes | 69 |
Total "Not Satisfied" Votes | 16 |
Total Rank Assessments | 13 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |