[Tutor] Difference between max(one, two) and max((one, two))
Chris “Kwpolska” Warrick
kwpolska at gmail.com
Wed Jul 10 10:07:05 CEST 2013
On Fri, Jul 5, 2013 at 8:37 PM, Amandeep Behl <amandeep.qa at gmail.com> wrote:
> and why with sum(one, two) we get an error whereas not with sum((one, two))
> ?
>
>
> On Fri, Jul 5, 2013 at 11:27 AM, Amandeep Behl <amandeep.qa at gmail.com>
> wrote:
>>
>> What is the difference between max(one, two) and max((one, two)) ?
>>
>> Thanks
>> Aman
>
>
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
First off, please do not top-post.
The answer to your questions is in the documentation: [0] and [1].
The difference between max(1, 2) and max((1, 2)) is none, pretty much.
max() takes either multiple arguments or an iterable, while sum()
takes only an iterable (and both take an optional argument for some
specific use).
[0]: http://docs.python.org/2/library/functions.html#max
[1]: http://docs.python.org/2/library/functions.html#sum
--
Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16
stop html mail | always bottom-post
http://asciiribbon.org | http://caliburn.nl/topposting.html
More information about the Tutor
mailing list