Ad
Code
Diff
  • def even_or_odd(n):  
        return "".join(('E','O','v','d','e','d','n')[n&1::2])
    
    • def even_or_odd(n):
    • return ('Even', 'Odd')[n & 1]
    • return "".join(('E','O','v','d','e','d','n')[n&1::2])
Code
Diff
  • def even_or_odd(n):  
        return 'Even' if n % 2 == 0 else 'Odd'
        
        
        
    
    • def even_or_odd(n):
    • return {0:'Even',1:'Odd'}[n % 2]
    • return 'Even' if n % 2 == 0 else 'Odd'