You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
286 B
17 lines
286 B
4 years ago
|
# test builtin sorted
|
||
|
try:
|
||
|
sorted
|
||
|
set
|
||
|
except:
|
||
|
print("SKIP")
|
||
|
raise SystemExit
|
||
|
|
||
|
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")
|