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 Answer

added 31 characters in body
Source Link
totallyhuman
  • 17.4k
  • 3
  • 34
  • 89

Python 2, 24(削除) 24 (削除ここまで) 16 bytes

-8 bytes thanks to FryAmTheEggman.

lambda n:sum(range(n+1))n*-~n/2

Try it online! Try it online!

Python 2, 24 bytes

lambda n:sum(range(n+1))

Try it online!

Python 2, (削除) 24 (削除ここまで) 16 bytes

-8 bytes thanks to FryAmTheEggman.

lambda n:n*-~n/2

Try it online!

Post Undeleted by totallyhuman
Post Deleted by totallyhuman
Source Link
totallyhuman
  • 17.4k
  • 3
  • 34
  • 89

Python 2, 24 bytes

lambda n:sum(range(n+1))

Try it online!

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