Skip to content

Instantly share code, notes, and snippets.

View telliott99's full-sized avatar

Tom Elliott telliott99

View GitHub Profile
import sys
from fractions import Fraction
prog, name, reps, lead = sys.argv[:4]
lead, reps = int(lead), int(reps)
L = [Fraction(s) for s in sys.argv[4:]]
L = L * reps
pL = []
def add_invert(n,d):
from matplotlib import pyplot as plt
import sys, random
N = int(sys.argv[1])
n = 100
L = list()
for i in range(N):
count = 0
prev = 0
from matplotlib import pyplot as plt
import random
N = 10000
n = 100
L = list()
tL = list()
v = 0
for i in range(N):
from matplotlib import pyplot as plt
import sys, random
k = int(sys.argv[1])
N = 100000
L = list()
for i in range(N):
v = 0
import math, operator
N = 1000
R = range(2,N)
D = dict()
for x in R:
D[x] = x**2
def is_square(x):
import math,sys
try:
N = int(sys.argv[1]) + 1
except:
print('enter the last value')
sys.exit()
R = range(2,N)
import math
from operator import itemgetter
t = math.pi
N = 1000
def find_bounds(d):
p = d*t
m = int(p)
n = m + 1
import sys, math
try:
r = int(sys.argv[1])
R = range(r)
except:
print('enter the number of cycles')
sys.exit()
def f(sin,cos):
cot = cos/sin
n = 5
s = 6
cot = 3**0.5
csc = 2
for i in range(n):
Co = s/cot
Ci = s/csc
print(i + 1, '%3.6f' % Co, '%3.6f' % Ci)
cot = cot + csc
from fractions import Fraction
N = 3
def f(x):
h = Fraction(1,2)
return h * (x + N/x)
def g(x,y):
return (x*y + N)/(x + y)