2024-07-13 00:16:47 -04:00
|
|
|
def uniq(ls: list) -> list:
|
|
|
|
r = []
|
|
|
|
for i in ls:
|
|
|
|
if i not in r:
|
|
|
|
r.append(i)
|
|
|
|
return r
|
2024-12-30 01:51:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
def int_(x, default=0):
|
|
|
|
return (
|
2025-01-01 09:32:24 -05:00
|
|
|
x
|
|
|
|
if isinstance(x, int)
|
|
|
|
else (int(x) if (isinstance(x, str) and x.isdigit()) else default)
|
2024-12-30 01:51:19 -05:00
|
|
|
)
|