f = lambda s:s[s.sort():1]+s[-1:] print(f([0, 15, 2, 3, 7, 18, -2, 9, 6, -5, 3, 8, 9, -14]))
Standard input is empty
[-14, 18]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!