Recursion would be a solution, especially if you wanted to repeat that process a ton of times, but would also be complicated for someone new to programming. What you want to look into is called an Array, which is a variable that can store multiple 'data types'(including obejcts in the scene, numbers, letters, etc.) and…