Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

2 of 3
added 53 characters in body
mathmandan
  • 1k
  • 11
  • 10

Python 3, (削除) 40 (削除ここまで) 38 bytes

Thanks to squid for saving 2 bytes!

lambda n:n in[i*i for i in range(n+1)]

Try it online!

Too slow to return an answer for 2147483647 in a reasonable amount of time, but would work given sufficient time.

(This works in Python 2 also, but note that Python 2 will yield an OverflowError on very large inputs, due to range.)

mathmandan
  • 1k
  • 11
  • 10

AltStyle によって変換されたページ (->オリジナル) /