Skip to content

Instantly share code, notes, and snippets.

View chinbrow's full-sized avatar

Luis Gonzalez chinbrow

View GitHub Profile
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'):
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'):
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"
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
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: "))
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!!!???")
def facto(n):
mul = 0
mul2 = 1
yon = "y"
if n == 0:
print(1)
else:
while mul != n:
mul += 1
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)
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)
def babylon(x):
div = x/3
times = 0
while times < 3:
times += 1
y = x / div
div = (div + y) / 2
return div