for i in map(abs, (-1,2): print(i)
list(map(abs, (-1, 2))
def depth(arr):
if hasattr(arr, '__getitem__'):
return max(depth(i) for i in arr) + 1
else:
return 0
def depth(arr):
if hasattr(arr, '__getitem__'):
return max(map(depth, arr)) + 1
else:
return 0
int p10[] = {0, 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 1000000000};
int change(int *a, int *b, int k, int l)
{
int rk, rl;
if(k <= 0 || k > 9 || l <= 0 || l > 9) return 1;
rk = ((*a/p10[k])%10);
rl = ((*b/p10[l])%10);
*a = *a - (rk*p10[k]) + (rl*p10[k]);
*b = *b - (rl*p10[l]) + (rk*p10[l]);
return 0;
}
только это не перегруженная функция.
#!/usr/bin/env python3
# coding: utf-8
db = {
'bob': {'name': 'Bob Smith', 'age': 42, 'pay': 30000, 'job': 'dev'},
'sue': {'name': 'Sue Jones', 'age': 45, 'pay': 40000, 'job': 'hdw'},
'tom': {'name': 'Tom', 'age': 50, 'pay': 0, 'job': None},
}
if __name__ == '__main__':
for k, v in db.items():
print(k, '=>\n', v)
if ($this->readyToProcess($timestamp, $seconds))
{
// do stuff
}