Skip to content

Instantly share code, notes, and snippets.

def return_prime(num):
prime = "is prime."
not_prime = "is not prime."
divisors = 0
if num > 1:
for i in range(2,num):
if (num % i) == 0:
divisors = divisors + 1
@nickgrier07
nickgrier07 / Help.py
Created February 18, 2019 07:48
Help xmick
List = [0,0,0,0,0,0,0,0,0]
full_list = []
for i in range(0, len(List)):
List[i] = 1
full_list.append(List[:])
List[i] = 0
@nickgrier07
nickgrier07 / Alph.txt
Last active June 5, 2019 06:44
File Edit Test
green apple
yellow flower
red mitten
happy days
white river
@nickgrier07
nickgrier07 / filetest02.py
Last active February 17, 2019 22:26
File test 02
with open("test.txt", "w") as txtstm:
txtlist = ("This ", "is ", "a ", "test.")
for i in txtlist:
txtstm.write(i)
@nickgrier07
nickgrier07 / filetest01.py
Created February 17, 2019 22:03
File Test 01
textstm = open("Inputstm.txt", 'w')
textlist = ("This ", "is ", "a ", "test.")
for i in textlist:
textstm.write(i)
textstm.close()
def return_keys(*keys):
ckeys = list(keys)
return ckeys
def return_values(*values):
cvalues = list(values)
@nickgrier07
nickgrier07 / conf.py
Last active June 5, 2019 03:17
Class test
class configure(object):
def __init__(self, internal, external, figure):
self.internal = internal
self.external = external
self.figure = figure
def expo(self):
try:
self.external = self.internal ** self.figure
@nickgrier07
nickgrier07 / Conf.py
Created June 9, 2018 18:20
Another Module Test
class Stuff(object):
def __init__(self, thing1, thing2, thing3):
self.thing1 = thing1
self.thing2 = thing2
self.thing3 = thing3
def info(self):
try:
print("This is a thing:", self.thing1)
print("This is also a thing:", self.thing2)
print("This is another thing:", self.thing3)
@nickgrier07
nickgrier07 / Conf.py
Last active June 9, 2018 16:55
Module experiment
class Configure(object):
def __init__(self, pointM, pointN):
self.pointM = pointM
self.pointN = pointN
self.native = True
def Points(self, M, N, n_):
try:
M = str(M)
N = str(N)
#Place a for loop inside of a funtion
def numaricalForLoop(start, finish, increment):
for i in range(start, finish, increment):
print(i)
numaricalForLoop(0, 20, 1)