How to figure out which button was pressed

I’m pretty sure MaxB meant by using the “in list () find the first occurrence of item ()” , which basically implies to avoid re-inventing the wheel.