def x(n):r=range(-n,n+1);print sum(a*a+b*b==n for a in r for b in r)x(0)
Standard input is empty
1
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!