+ 1
How to create a function in python, which takes an array and returns a new array containing the values of the given array provid
How to create a function in python, which takes an array and returns a new array containing the values of the given array provided as a parameter incremented by 1, without modify the original array? For example, The array is: [[1, 2, 3], [4, 5, 6]] The new array: [[2, 3, 4], [5, 6, 7]]
1 Odpowiedź
+ 3
For your example:
return [[n+1 for n in arr] for arr in array]