Skip to content

Add last_digit function with type hints and doctests #12852

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

prachi757
Copy link

Describe your change:

  • Add an algorithm

This PR adds a new function last_digit under the maths/special_numbers directory.

Details:

  • Returns the last digit of a given integer (positive or negative)
  • Uses proper Python type hints
  • Includes well-written doctests that pass all automated tests
  • Complies with naming and formatting conventions

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, I have not combined unrelated changes.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • This algorithm does not include an external reference URL, as it's a basic concept.

@algorithms-keeper algorithms-keeper bot added the awaiting reviews This PR is ready to be reviewed label Jul 16, 2025
@prachi757
Copy link
Author

Hi maintainers 👋
I've updated the parameter name as suggested. All checks are passing ✅
Kindly requesting a review and approval when convenient.
Thank you for your time and this amazing project! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting reviews This PR is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy