Kilgrave Python Functions
Kilgrave Python Functions
ceil(x) Returns the smallest integer greater than or equal to x e mathematical constant e (2.71828...)
copysi‐ Returns x with the sign of y * import math and use math.fun()
gn(x, y)
factorial(x) Returns the factorial of x S.add(e) Adds the element e to the set S
floor(x) Returns the largest integer less than or equal to x S1.update(S2) Adds the items specified in the set S2 to the set S1
fmod(x, y) Returns the remainder when x is divided by y S.remove(e) Remove the element e from the set S
isfinite(x) Returns True if x is neither an infinity nor a NaN (Not a S.pop() Removes any element from the set S
Number) S.clear() Remove all element from the set S
isinf(x) Returns True if x is a positive or negative infinity S.copy() Creates a copy of the set S
isnan(x) Returns True if x is a NaN S1.union(S2) Returns a set containing elements from both S1
ldexp(x, i) Returns x (2*i) and S2
modf(x) Returns the fractional and integer parts of x S1.intersect‐ Returns a set containing elements common in set
exp(x) Returns e**x ion(S2) S1 and S2
expm1(x) Returns e**x – 1 S1.differenc‐ Returns a set containing elements in set S1 but not
e(S2) in S2
log(x[, Returns the logarithm of x to the base (defaults to e)
base]) S1.symmetric‐ Returns a set containing elements which are in one
_differen‐ of the either sets S1 and S2, but not in both
log2(x) Returns the base-2 logarithm of x
ce(S2)
log10(x) Returns the base-10 logarithm of x
pow(x, y) Returns x raised to the power y String Functions
sqrt(x) Returns the square root of x S.coun‐ Counts the number of times string str occurs in string S
acos(x) Returns the arc cosine of x t(str)
asin(x) Returns the arc sine of x S.find‐ Returns index of first occurrence of string str in string S,
atan(x) Returns the arc tangent of x (str) and -1 if str is not present int string S
atan2(y, x) Returns atan(y / x) S.rfin‐ Returns index of last occurrence of string str in string S,
d(str) and -1 if str is not present in string S
cos(x) Returns the cosine of x
S.capi‐ Returns a string that has first letter of the string S in
hypot(x, y) Returns the Euclidean norm, sqrt(xx + yy)
talize() uppercase and rest of the characters in lowercase
sin(x) Returns the sine of x
S.title() Returns a string that has first letter of every word in the
tan(x) Returns the tangent of x
string S in uppercase and rest of the characters in
degrees(x) Converts angle x from radians to degrees lowercase
radians(x) Converts angle x from degrees to radians S.lower() Returns a string that has all uppercase characters in
gamma(x) Returns the Gamma function at x string S converted into lowercase characters
S.upper() Returns a string that has all lower characters in string S S.isdi‐ Returns True if all characters in string S comprise of
converted into uppercase characters git() digits only, else False
S.swap‐ Returns a string that has all lowercase characters in S.isal‐ Returns True if all characters in string S comprise of
case() string S converted into uppercase characters and vice num() alphabets and digits only, else False
versa S.star‐ Returns True if string S starts with string str,else False
S.isup‐ Returns True if all alphabets in string S are in upperc‐ tswith‐
per() ase,else False (str)
S.islo‐ Returns True if all alphabets in string S are in lowerc‐ S.ends‐ Returns True if string S ends with string str,else False
wer() ase,else False with(str)
S.istitle() Returns True if string S is in titlecase S.enco‐ Returns S in encoded format according to the given
S.repl‐ Returns a string that has every occurrence of string str1 de(str) encoding scheme
ace(st‐ in S replaced by with the occurrence of string str2 S.deco‐ Returns the decoded string S according to the given
r1,str2) de(str) encoding scheme
S.strip() Returns a string that has whitespaces in S removed from
start and end List
S.lstrip() Returns a string that has whitespaces in S removed from L.appe‐ Adds the element e to the end of the list L
start nd(e)
S.rstrip() Returns a string that has whitespaces in S removed from L.exte‐ Adds the items specified in the list L2 at the end of the
end nd(L2) list L
S.split(d‐ Returns a list formed by splitting the string S into various L.remo‐ Remove the element e from the list L
elimeter) substring. The delimeter is used to mark the split points ve(e)
S.partiti‐ Partitions the string S into two parts base on delimeter L.pop(i) Removes the element specified at index i from the list
on(del‐ and returns a tuple comprising of string before delimeter L*
imeter) L.count(e) Returns count of occurrence of element e in list L
S.join(se‐ Returns a string comprising of elements of the sequence L.index(e) Returns index of element e from list L
quence) separated by delimeter S
L.insert(i,e) Returns element e at the index i in list L
S.issp‐ Returns True if all characters in string S comprise of
L.sort() Sorts the elements of the list L
ace() whitespace characters only,i.e. ' ', '\n', '\t' else False
L.reverse() Reverses the order elements in list L
S.isal‐ Returns True if all characters in string S comprise of
pha() alphabets only, else False
File Handling