Skip to content

Commit

Permalink
Improved get_tags method, added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
VadVergasov committed Jul 6, 2024
1 parent 976374f commit 8a52dc2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions codeforces_api/parse_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ def get_tags(self, contest_id, index, include_rating=False):
index = chr(ord("A") + int(index))
index = index.capitalize()
try:
return sorted(self.problem_tags[str(contest_id)][index])
if include_rating:
return self.problem_tags[str(contest_id)][index]
return self.problem_tags[str(contest_id)][index][1:]
except KeyError:
return sorted(self.problem_tags[str(int(contest_id) - 1)][index])
# If problem included in more than one division.
if include_rating:
return self.problem_tags[str(int(contest_id) - 1)][index]
return self.problem_tags[str(int(contest_id) - 1)][index][1:]

0 comments on commit 8a52dc2

Please sign in to comment.