Dec-11-2019, 10:47 PM
I'd like to pass a tuple (2, 3) as a parameter value into a function (via array variable below), so that it replaces the slice value 2:3 in the third line. What would be the easiest way to achieve that?
def function(object, array, slices): selections = ... object ... for i, selection in enumerate(selections[2:3]): # <= array variable replaces 2:3 for x, y in slices: slur(object[x : y]) object = ... tupleIndice = (2, 3) tupleSlices = (0, 3), (3, 5) function(staff, tupleIndice, tupleSlices)My apology if this may not be the right place to ask this question. Thank you for your time and suggestion!