This repository was archived by the owner on Apr 1, 2021. It is now read-only.
Article: Python-Function-MAX.md#1045
Merged
3 commits merged intofreeCodeCamp:masterfrom May 27, 2016
varunu28:master
Merged
Conversation
| `max()` is a built-in function in Python 3. It returns the largest item in an iterable or the largest of two or more arguments. | ||
|
|
||
| ## Arguments | ||
| This function takes two or more numbers or any kind of iterable as an argument. While giving an iterable as an argument we must make sure that all the elements in the iterable are of the same type. This means that we cannot pass a list which has both string and integer values stored in it. |
Member
There was a problem hiding this comment.
- This function takes two or more numbers or any kind of iterable as an argument
+ This function takes two or more numbers, or any kind of iterable as an argumentWhen you say numbers, what do you mean? int or float? Or both?
Member
There was a problem hiding this comment.
It can also compare between Strings, right?
Contributor
Author
There was a problem hiding this comment.
Yes.
It can take both int and floats and it can even compare them together.
It works for strings too. It checks for lexicographical order.
eg: max('abc', 'abb', 'abc') # returns 'abc'
Member
LGTM 👍Let's |
Contributor
Author
67 tasks
|
@varunu28 Just updated! |
Contributor
Author
|
@atjonathan There are 2 articles which are not updated. min and pow. Kindly check |
trishulpani
pushed a commit
to trishulpani/wiki
that referenced
this pull request
May 28, 2016
* Create Python-Function-MAX.md * Update Python-Function-MAX.md * Update Python-Function-MAX.md
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.