DEV Community

Nirab Shrestha
Nirab Shrestha

Posted on

A challange for you python devs all

Try to crack this code, and let's see who is correct. Try to see what these two files do.
This is the first
(imago.py)

listC = lambda З: type("listC",(object,),{'__init__': lambda self, x: setattr(self, "data", x),'__call__': lambda self: list(self.data)})(З)
Enter fullscreen mode Exit fullscreen mode

and,

from imago import listC; import sys; _print=lambda *a,sep=" ",end="\n",file=None,flush=False:(f:=file or sys.stdout).write(sep.join(map(str,a))+end) or (f.flush() if flush else None); (lambda ю: (ю.ф(), _print(listC(input())())))(type("З",(object,),{'__init__':lambda self:setattr(self,'data','hello from the one liner maniac'),'ф':lambda self:_print(self.data)})())

Enter fullscreen mode Exit fullscreen mode

the second

Top comments (1)

Collapse
 
nirab_shrestha_0c0e04d4a9 profile image
Nirab Shrestha

Do it know