X Tutup
The Wayback Machine - https://web.archive.org/web/20260214231304/https://github.com/TheAlgorithms/Python/pull/2654
Skip to content

Reverse string#2654

Closed
technophile22 wants to merge 3 commits intoTheAlgorithms:masterfrom
technophile22:reverse-string
Closed

Reverse string#2654
technophile22 wants to merge 3 commits intoTheAlgorithms:masterfrom
technophile22:reverse-string

Conversation

@technophile22
Copy link

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

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, please open separate PRs for separate algorithms.
  • 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.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

# creating a string slice that starts at the end of the string, and moves backwards.
# the slice statement [::-1] means start at the end of the string and end at position 0,
# move with the step negative one, which means one step backwards.
return "".join(word[::-1])
Copy link
Contributor

Choose a reason for hiding this comment

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

You can just do return word[::-1] for this task.

Also, I feel like the point of this repository is to show the underlying implementations instead of using existing python ones.

Copy link
Author

Choose a reason for hiding this comment

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

I did the same in my previous commit, but it was showing Process completed with exit code 1 error, that's why I added the join method but still, it's showing the same error.

okay, I am new here. I will surely keep that in mind from next time.

@stale
Copy link

stale bot commented Nov 21, 2020

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Used to mark an issue or pull request stale. label Nov 21, 2020
@stale
Copy link

stale bot commented Dec 10, 2020

Please reopen this pull request once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to seek help from our Gitter or ping one of the reviewers. Thank you for your contributions!

@stale stale bot closed this Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Used to mark an issue or pull request stale.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup