We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 77f9e35 commit 50c5bf8Copy full SHA for 50c5bf8
kotlin-website.py
@@ -129,9 +129,13 @@ def get_nav():
129
return nav
130
131
def get_countries_size():
132
- def match_string(string):
133
- return re.search(r'\((.*?)\)', string.get("location")).group(1)
134
- matches = set(map(match_string, site_data['universities']))
+ def match_string(entry):
+ location = entry.get("location", "")
+ # Extract the last part as the country code
135
+ return location.split(",")[-1].strip()
136
+
137
+ # Extract unique countries, ignoring any None results
138
+ matches = set(filter(None, map(match_string, site_data['universities'])))
139
return len(matches)
140
141
0 commit comments