Skip to content
This repository has been archived by the owner on Apr 1, 2021. It is now read-only.

Article: Python-Function-MAX.md #1045

Merged
3 commits merged into from
May 27, 2016
Merged

Article: Python-Function-MAX.md #1045

3 commits merged into from
May 27, 2016

Conversation

varunu28
Copy link
Contributor

No description provided.

`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.
Copy link
Member

Choose a reason for hiding this comment

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

- 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 argument

When you say numbers, what do you mean? int or float? Or both?

Copy link
Member

Choose a reason for hiding this comment

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

It can also compare between Strings, right?

Copy link
Contributor Author

@varunu28 varunu28 May 27, 2016

Choose a reason for hiding this comment

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

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'

@alayek alayek self-assigned this May 27, 2016
@alayek alayek added this to the June Summit milestone May 27, 2016
@alayek
Copy link
Member

alayek commented May 27, 2016

LGTM 👍

Let's :shipit: 📦

@alayek alayek assigned ghost and unassigned alayek May 27, 2016
@ghost ghost merged commit 0db4451 into freeCodeCamp:master May 27, 2016
@BerkeleyTrue BerkeleyTrue removed the QA label May 27, 2016
@varunu28
Copy link
Contributor Author

@alayek please update #819

@ghost
Copy link

ghost commented May 27, 2016

@varunu28 Just updated!

@varunu28
Copy link
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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants