Skip to content

Instantly share code, notes, and snippets.

@marclave
Created July 8, 2014 15:24
Show Gist options
  • Save marclave/6c37c81c4f3eb3a10a46 to your computer and use it in GitHub Desktop.
Save marclave/6c37c81c4f3eb3a10a46 to your computer and use it in GitHub Desktop.
Code Golf Leibniz formula for π
for _ in[1]*input():print sum((-1.0)**x/(2*x+1)for x in range(input()))
@marclave
Copy link
Author

marclave commented Jul 8, 2014

Scored 22.9/24.70
#0

0.04s : Success
#1

2.69s : Success

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment