<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delete_location(self, location_name):
 """ Remove location with name location_name from self.locations. If the location had any sites, change site.location to "". """

        location = self.find_by_name(location_name, self.locations)
        if not location:
            return False
        sites = location.sites
        self.locations.remove(location)
        for site in sites:
            if site:
                site.location = ''
        del location
        return sites