2015-04-04 22:05:30 +01:00
|
|
|
# test builtin sorted
|
2017-03-08 23:07:19 +00:00
|
|
|
try:
|
|
|
|
sorted
|
|
|
|
set
|
|
|
|
except:
|
|
|
|
print("SKIP")
|
2017-06-10 18:03:01 +01:00
|
|
|
raise SystemExit
|
2015-04-04 22:05:30 +01:00
|
|
|
|
|
|
|
print(sorted(set(range(100))))
|
|
|
|
print(sorted(set(range(100)), key=lambda x: x + 100*(x % 2)))
|
|
|
|
|
|
|
|
# need to use keyword argument
|
|
|
|
try:
|
|
|
|
sorted([], None)
|
|
|
|
except TypeError:
|
|
|
|
print("TypeError")
|