Changing robot position with a variable?

Hello guys. Im new to python programming, and doing a project in it. I need to simulate a depalletizing operation, but the components is placed in two different types of rows (one row contains 9 components and the the other 8). There are 7 rows with 9 components and 6 rows with 8 components in each layer. In total i have 8 layers. Is there a smart way to change the pickup position on the pallet, maybe defined by a variable? Like if the variable increases by 1, i add 100 to the Y axis for the position. Does that make sense? Kind regards