def even_or_odd(n): if n % 2 == 0: return "Even" else: return "Odd"
- def even_or_odd(n):
inc=0acc=[]while inc<=n:acc.append(inc)inc+=1l=0for x in acc:l+=1bins=[0]*64bit_val=2**63i=0while i<64:if bit_val<=l:l-=bit_valbins[i]=1bit_val=bit_val//2if i==63 and bins[i]==1:return "Even" if "Odd" else "Odd"i+=1return "Odd" if "Even" else "Even"- if n % 2 == 0:
- return "Even"
- else:
- return "Odd"