What I'm trying to do is if a rect has been clicked, it is selected and text will display, but if its clicked again, then it is de-seleced and the text goes away.
list_of_rect is a list of coordinates (x, y, width, height) representing the position and size of the rect.
render_display just shows the screen with text.
if event.type == pygame.MOUSEBUTTONUP and event.button == 1:
x, y = event.pos
for i in range(len(list_of_rect)):
j = list_of_rect[i]
if j <= x <= (j + j) and j <= y <= \
(j + j):
Try having a list, like this:
rects_clicked = 
Then, in your event code:
if j not in rects_clicked: #undisplay text rects_clicked.append(j) else: #display text rects_clicked.remove(j)