I'm learning python. The idea of the app is that there are 8 rectangles which when clicked turn off or on representing binary. Each rectangle representing a bit, and the decimal equivalent will be displayed.
I'm having difficulty translating that into a well written app without hard coding everything. I hard coded the 8 rects using .fill but I would prefer to use a function which does that automatically. I don't want the full code I'd rather have someone point me in the right direction in regards to the structure of the code I should follow. Should I use a class to initiate a new rect then use a render method with a for loop to run through an array of the rectangles, if so, how would I display the rectangles in a row?
To draw the rectangles I am sticking to display.fill()
I considered to hardcore the properties of each rectangle into a tuple of tuples then render each with a for loop, is this a good approach?