Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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
prachi757 wants to merge 2 commits into TheAlgorithms:master
base: master
Choose a base branch
Loading
from prachi757:add-last-digit

Conversation

Copy link

@prachi757 prachi757 commented Jul 16, 2025

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
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
Reviewers
2 more reviewers

@anandfresh anandfresh anandfresh approved these changes

@mindaugl mindaugl mindaugl approved these changes

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
awaiting reviews This PR is ready to be reviewed
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /