This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #compose a list | |
| def creatNumericalList(finish, increment) : | |
| emptyList = [] | |
| for i in range(1, finish, increment): | |
| emptyList.append(i) | |
| return emptyList |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def return_keys(*keys): | |
| ckeys = list(keys) | |
| return ckeys | |
| def return_values(*values): | |
| cvalues = list(values) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| textstm = open("Inputstm.txt", 'w') | |
| textlist = ("This ", "is ", "a ", "test.") | |
| for i in textlist: | |
| textstm.write(i) | |
| textstm.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with open("test.txt", "w") as txtstm: | |
| txtlist = ("This ", "is ", "a ", "test.") | |
| for i in txtlist: | |
| txtstm.write(i) |
OlderNewer