Skip to content

Instantly share code, notes, and snippets.

View saravanareddy's full-sized avatar

saravanareddy

View GitHub Profile
@saravanareddy
saravanareddy / gist:1896353
Created February 24, 2012 00:46
Python one liner
from random import random
print "Pi:", sum(1 for i in range(2000000) if (random()**2 + random()**2) < 1)/2000000.0 * 4