Skip to content

Commit

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

0 comments on commit 976374f

Please sign in to comment.