[Tutor] this group and one liners

Alan Gauld alan.gauld at yahoo.co.uk
Fri Jul 8 18:08:30 EDT 2022


On 08/07/2022 22:52, avi.e.gross at gmail.com wrote:

> We know max(1,2,3) fails as it demands an iterable like [1,2,3] 

Nope.

max(1,2,3)

works just fine for me. Its only a single value that fails:

>>> max(1,2,3)
3
>>> max(3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'int' object is not iterable
>>>

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list