This is the 245th most frequent Italian word.
ex
A former partner or spouse.
In this sentence, 'ex' is used as a noun referring to a former romantic partner.
Il mio ex ha cambiato città.
My ex-boyfriend has moved to another city.
Here, 'ex' is used as a prefix indicating 'former' or 'previous' in the context of someone's role or position.
Ex presidenti spesso scrivono memorie.
Former presidents often write memoirs.
In this case, 'ex' is used as a prefix to denote that the referred school no longer functions as an elementary school.