Ad
Code
Diff
  • def is_even(n):
        return not(n%2)
    • # is_even = lambda *a: ~a[0] & 1
    • is_even = lambda a: not (a & 1)
    • def is_even(n):
    • return not(n%2)
Code
Diff
  • def is_even(n):
        return not(n%2)
        
    • is_even=lambda x: ~ x&1
    • def is_even(n):
    • return not(n%2)
Code
Diff
  • def return_hundred(): 
        return 100
        
    # with help from wolframalpha
    • import math
    • def return_hundred():
    • return (math.log( 2**3 * 37 * ((5 * 11 * (2**10-5) * 2**15 * 3**4) + 7))/math.pi )**2
    • def return_hundred():
    • return 100
    • # with help from wolframalpha
Code
Diff
  • def is_even(x):
        return abs((x % 2)-1)
    
    • is_even = lambda x: not x % 2
    • def is_even(x):
    • return abs((x % 2)-1)
Code
Diff
  • def even_or_odd(number):
        l={0:"Even",1:"Odd"}
        return l[number%2]
    • def even_or_odd(number):
    • #good luck
    • l={0:"Even",1:"Odd"}
    • return l[number%2]