Skip to content

Instantly share code, notes, and snippets.

View buzzerrookie's full-sized avatar

Tao Sun buzzerrookie

View GitHub Profile
@buzzerrookie
buzzerrookie / twinprimes.py
Last active January 23, 2016 09:37
Python code for twin prime pairs
#!/usr/bin/python
M = 1000
N = 1500
isprime = [True] * (N + 1)
isprime[0] = False
isprime[1] = False
count = 0;
i = 2
while i <= N:
if not isprime[i]:
@buzzerrookie
buzzerrookie / isa.py
Created January 28, 2016 07:07
Python program to compute International Standard Atmosphere
import sys
import math
g = 9.80665
R = 287.00
def cal(p0, t0, a, h0, h1):
if a != 0:
t1 = t0 + a * (h1 - h0)
p1 = p0 * (t1 / t0) ** (-g / a / R)
else: