Ad
Code
Diff
  • even_or_odd = lambda _: "Odd" if _ & 1 else "Even"
    • even_or_odd = lambda _:"Odd"if _&1else"Even"
    • even_or_odd = lambda _: "Odd" if _ & 1 else "Even"
Code
Diff
  • even_or_odd = lambda n: ('EOvdedn')[n & 1::2]
        
    
    • def even_or_odd(n):
    • return ('EOvdedn')[n & 1::2]
    • even_or_odd = lambda n: ('EOvdedn')[n & 1::2]
Code
Diff
  • def even_or_odd(n):
        return ('EOvdedn')[n & 1::2]
    
    • def even_or_odd(n):
    • return 'Odd' if n % 2 else 'Even'
    • return ('EOvdedn')[n & 1::2]
Code
Diff
  • word = 'hello'
    print(''.join([i if i != 'o' else '' for i in word]))
    • print ("hello")
    • word = 'hello'
    • print(''.join([i if i != 'o' else '' for i in word]))

even or not?

Code
Diff
  • def even_or_odd(number):
        return "EOvdedn"[number & 1::2]
    • def even_or_odd(number):
    • return "EOvdedn"[number % 2::2]
    • return "EOvdedn"[number & 1::2]