Skip to content

Instantly share code, notes, and snippets.

from sys import exit
test1 = raw_input("Please enter an integer: ")
test2 = raw_input("Please enter another integer: ")
if (test1.isdigit() and test2.isdigit()) == True:
test1 = int(test1)
test2 = int(test2)
else:
#compose a list
def creatNumericalList(finish, increment) :
emptyList = []
for i in range(1, finish, increment):
emptyList.append(i)
return emptyList
class Teach(object):
def __init__(self, master, student):
self.master = master
self.student = student
self.wise = True
def Teaching(self, master, student, wise):
if self.wise:
print("The "+master+" teaches the "+student+".")
else:
#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)
@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)
@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 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
def return_keys(*keys):
ckeys = list(keys)
return ckeys
def return_values(*values):
cvalues = list(values)
@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()
@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)