Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed difficulty parsing in problem() #4

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

hugo-morvan
Copy link

changed the difficulty parsing in the problem() function to match how it is done in problems() as the problem() function throws a ValueError when the problem has a range of difficulty.

Copy link
Owner

@RussellDash332 RussellDash332 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the catch!

@RussellDash332 RussellDash332 merged commit 09b6c57 into RussellDash332:main Nov 11, 2024
@hugo-morvan
Copy link
Author

Hey, I believe my fix for the problem was wrong because API response is structured/handled differently between problem() and problems(). I think difficulty = float((re.findall('[\d\.]+', div_text[0]) or [None])[-1]) if div_text else None would do the trick, but you might want to double check.
Sorry for the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants