There is no doubt that uncontrolled mixing between members of the opposite sex, especially in the period close to adolescence, is really serious. If a Muslim is living in a society that does not restrict mixing, he has no alternative but to be patient and do his best to adhere to the teachings of Islam.
hence, there is nothing wrong in joining co-educational schools or colleges, so long as the Muslim males and females abide by the rules of Islam and avoid that which is prohibited.
Elaborating on this, Sheikh Faysal Mawlawi, Deputy Chairman of the European Council for Fatwa and Research, who states the following: “A Muslim may live in (a non-Muslim society or in) a society that does not seek Almighty Allah’s pleasure.

Seeking knowledge is a collective duty upon Muslim males and females. Having co-educational schools does not entail that Muslims give up education.
It is right that we should do our best so that there be no mixed education and choose the single-sex schools to join if they are available.
But if there are only co-educational schools, there is no blame if one continues studying in the mixed school as long as they stick to the teachings of Islam with regard to mixing between people of the opposite sex. Hence, one might join the mixed school so long as we try to abide by the teachings of Islam.”