Ad
Code
Diff
  • cap = lambda *a: -sum((-sum(a), min(a), max(a)))
    • def cap(low, high, num):
    • x, y = min(low, high, num), max(low, high, num)
    • return sum([low, high, num]) - sum([x, y])
    • cap = lambda *a: -sum((-sum(a), min(a), max(a)))
Code
Diff
  • result = lambda n: (n > 70) * n // 10 or 'fail'
    • result = lambda n: [n // 10, 'fail'][n < 70]
    • result = lambda n: (n > 70) * n // 10 or 'fail'
Code
Diff
  • result = lambda n: 'fail' if n < 70 else n // 10
    • def result(n): return 'fail' if n < 70 else int(n / 10)
    • result = lambda n: 'fail' if n < 70 else n // 10