diff --git a/COVID19Py/covid19.py b/COVID19Py/covid19.py index a68faa7..b7d2203 100644 --- a/COVID19Py/covid19.py +++ b/COVID19Py/covid19.py @@ -156,3 +156,11 @@ def getLocationById(self, country_id: int): """ data = self._request("/v2/locations/" + str(country_id)) return data["location"] + + def checkForType(countryToCheck): + if isinstance(checker, int): + getLocationById(countryToCheck) + elif len(checker) <=2: + getLocationByCountryCode(countryToCheck) + else: + getLocationByCountry(countryToCheck)