Any Python programmer would certainly write something like this:
def find_extremes(i):
return min(i), max(i)
Obviously, it's impossible to see any benefits of Python if you write it like C.
And your Perl example is contrived; it would occupy a microscopic portion of any real program.
(By the way, you shouldn't call a variable "set". You're shadowing an extremely useful built-in data type by doing so.)