Skip to content

Improvements to combinations.py #3682

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

Closed
Rolv-Apneseth opened this issue Oct 24, 2020 · 1 comment
Closed

Improvements to combinations.py #3682

Rolv-Apneseth opened this issue Oct 24, 2020 · 1 comment

Comments

@Rolv-Apneseth
Copy link
Contributor

I have made some improvements to combinations.py. Pr #3681 (Forgot to make issue before submitting pr apologies)

Added:

  • A description at the top, which includes a wikipedia link
  • Type hints to the combinations function
  • Some more doctests, which include 0 and negative numbers
  • A check within the function so the function does not attempt to get factorials of negative numbers
  • Some print statements in the main block which show some practical applications of the function

If you would like anything else, or if you don't like the changes, please let me know. Thanks!

@Rolv-Apneseth
Copy link
Contributor Author

If this is ok, I can try to do the same for some other .py files which might need some extra touches like this

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

No branches or pull requests

1 participant