Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
numbers = [10, 45, 20, 67, 29, 12, 15, 99, 40, 23]
# Repalce the "None" values with your solutions
last_number = None
before_last_number = None
first_number = None
seventh_number = None
first_five_numbers = None
last_three_numbers = None
# Get the numbers from the third number (inclusive) to the sixth number (inclusive)
third_to_sixth_numbers = None
reversed_numbers = None
# Tests
nose.tools.assert_equal(23, last_number)
nose.tools.assert_equal(40, before_last_number)
nose.tools.assert_equal(10, first_number)
nose.tools.assert_equal(15, seventh_number)
nose.tools.assert_sequence_equal([10, 45, 20, 67, 29], first_five_numbers)
nose.tools.assert_sequence_equal([99, 40, 23], last_three_numbers)
nose.tools.assert_sequence_equal([20, 67, 29, 12], third_to_sixth_numbers)
nose.tools.assert_sequence_equal([23, 40, 99, 15, 12, 29, 67, 20, 45, 10], reversed_numbers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment