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 present_part(a): | |
| b = a[:-1] | |
| if a.endswith("ee") or a=="be": | |
| a = a + "ing" | |
| return a | |
| elif a.endswith("ie"): | |
| a = a[:-2] | |
| a = a + "ying" | |
| return a | |
| elif a.endswith('e'): |
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 present_part(a): | |
| b = a[:-1] | |
| if a.endswith("ee") or a=="be": | |
| a = a + "ing" | |
| return a | |
| elif a.endswith("ie"): | |
| a = a[:-2] | |
| a = a + "ying" | |
| return a | |
| elif a.endswith('e'): |
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 third_person(a): | |
| if a.endswith("y"): | |
| a = a[:-1] | |
| a = a + "ies" | |
| return a | |
| elif a.endswith('o')or a.endswith('s') or a.endswith('x') or a.endswith('z'): | |
| a = a + "es" | |
| return a | |
| elif a.endswith("sh") or a.endswith('ch'): | |
| a = a + "es" |
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 summ(a,b): | |
| return a+b | |
| def subs(a,b): | |
| return a-b | |
| def mult(a,b): | |
| return a*b | |
| def div(a,b): | |
| return a//b | |
| def intege(a,b): | |
| return a%b |
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 sum_of(a,b): | |
| if a > b: | |
| a,b = b,a | |
| add = a | |
| while add != b: | |
| add += 1 | |
| a += add | |
| return a | |
| a = int(input("Give me the lower bound of the list of summation: ")) |
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 random import randint | |
| def random(guess): | |
| correct = randint(0,100) | |
| while guess != correct: | |
| if guess > correct: | |
| guess = int(input("Too high, guess again!: ")) | |
| elif guess < correct: | |
| guess = int(input("Too low, guess again!: ")) | |
| else: | |
| return print("What was that!!!???") |
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 facto(n): | |
| mul = 0 | |
| mul2 = 1 | |
| yon = "y" | |
| if n == 0: | |
| print(1) | |
| else: | |
| while mul != n: | |
| mul += 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
| import statistics | |
| def ten_nums(x): | |
| nums = many = 0 | |
| stan = statistics.stdev(x) | |
| for i in x: | |
| nums += i | |
| many += 1 | |
| many = nums/many | |
| return (nums, many, stan) |
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 file_char(x): | |
| chars = words = lines = 0 | |
| with open(x, 'r') as in_file: | |
| for line in in_file: | |
| line = line.strip() | |
| lines += 1 | |
| words += len(line.split(" ")) | |
| chars += len(line) | |
| return (chars, words, lines) |
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 babylon(x): | |
| div = x/3 | |
| times = 0 | |
| while times < 3: | |
| times += 1 | |
| y = x / div | |
| div = (div + y) / 2 | |
| return div |