Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
numbers = np.array([
[10, 30, 100, 1000],
[30, 20, 10, 70]
])
# Repalce the "None" values with your solutions
# Divide each number by 2
numbers_divided_by_two = None
# Add 5 to each number
numbers_plus_five = None
# Add this array: [[10, 20, 44, 1], [10, 10, 15, 30]] to the "numbers" array
new_numbers = None
# Tests
nose.tools.assert_sequence_equal([[5.0, 15.0, 50.0, 500.0], [15.0, 10.0, 5.0, 35.0]], numbers_divided_by_two.tolist())
nose.tools.assert_sequence_equal([[15, 35, 105, 1005], [35, 25, 15, 75]], numbers_plus_five.tolist())
nose.tools.assert_sequence_equal([[20, 50, 144, 1001], [40, 30, 25, 100]], new_numbers.tolist())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment