Skip to content

Update abs_Max.py #997

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

Merged
merged 2 commits into from
Jul 11, 2019
Merged

Update abs_Max.py #997

merged 2 commits into from
Jul 11, 2019

Conversation

SandersLin
Copy link
Contributor

fix docstring for doctest to work properly (add space after >>>). Added another possible method of finding abs_max(), Changed function name according to repo guidelines. I understand these changes are trivial ,please close PR if so.

fix docstring for doctest to work properly (add space after >>>)
@cclauss
Copy link
Member

cclauss commented Jul 10, 2019

Let's add Python type hints to make it even more impressive:

from typing import List


def abs_max(x: List[int]) -> int:

@cclauss
Copy link
Member

cclauss commented Jul 10, 2019

Also, see why the Travis CI tests are failing.

@SandersLin
Copy link
Contributor Author

Great Advice. Updated.

Copy link
Member

@cclauss cclauss left a comment

Choose a reason for hiding this comment

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

A+... Nice changes here.

Other tests to consider in the future...

>>> abs_max("Python")
>>> abs_max(tuple(-1, -2, -3))
>>> abs_max([])
>>> abs_max([-1, -0.9, -1.0])
>>> abs_max([3,-10,-2]) == abs_max_sort([3,-10,-2])

@cclauss cclauss merged commit b79a197 into TheAlgorithms:master Jul 11, 2019
@SandersLin SandersLin deleted the patch-19 branch July 11, 2019 05:17
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* Update abs_Max.py

fix docstring for doctest to work properly (add space after >>>)

* Update abs_Max.py
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