Skip to main content
Commonmark migration
Source Link

#Python 2, 76 bytes

Python 2, 76 bytes

lambda l:filter(lambda n:eval(("sum(map(int,`n`))**.5==int("*2)[:-6]+")"),l)

Try it here!

Some abuse of eval to check for a square number, rest is pretty unspectacular.
The eval statement evaluates to sum(map(int,n))**.5==int(sum(map(int,n))**.5)

#Python 2, 76 bytes

lambda l:filter(lambda n:eval(("sum(map(int,`n`))**.5==int("*2)[:-6]+")"),l)

Try it here!

Some abuse of eval to check for a square number, rest is pretty unspectacular.
The eval statement evaluates to sum(map(int,n))**.5==int(sum(map(int,n))**.5)

Python 2, 76 bytes

lambda l:filter(lambda n:eval(("sum(map(int,`n`))**.5==int("*2)[:-6]+")"),l)

Try it here!

Some abuse of eval to check for a square number, rest is pretty unspectacular.
The eval statement evaluates to sum(map(int,n))**.5==int(sum(map(int,n))**.5)

Source Link
Denker
  • 6.9k
  • 1
  • 24
  • 66

#Python 2, 76 bytes

lambda l:filter(lambda n:eval(("sum(map(int,`n`))**.5==int("*2)[:-6]+")"),l)

Try it here!

Some abuse of eval to check for a square number, rest is pretty unspectacular.
The eval statement evaluates to sum(map(int,n))**.5==int(sum(map(int,n))**.5)