Python - Coding Terms/Commands Flashcards
Return the absolute value of a number. The argument may be an integer or a floating point number. If the argument is a complex number, its magnitude is returned.
abs(x)
Return True if all elements of the iterable are true (or if the iterable is empty).
all(iterable)
Return True if any element of the iterable is true. If the iterable is empty, return False.
any(iterable)
allows to loop over something and have an automatic counter.
enumerate(iterable, start=0)
allows user to input.
.input([prompt])
a string method and returns a string in which the elements of sequence have been joined by str separator.
.join() function
Return the lowest valued number.
min()
Return the highest valued number.
max()
return a random integer n such that a<= n <= b.
random.randint(a,b)
generates a sequences of numbers in the form of a list.
.range()
break a large string down into smaller strings.
.split()
method inserts the specified value at the specified position.
.insert()
returns a list of dict’s (key, value) tuple pairs
.items()
method appends an element to the end of the list
.append()
an inbuilt function in Python that removes and returns last value from the list or the given index value
.pop()
return an integer object from any number or string
int
returns data as a string
str
an inbuilt function that returns a copy of the string where all occurrences of a substring is replaced with another substring.
.replace()
returns the length of a specific string
len
returns a copy of the string in which all case-based characters have been uppercased.
.upper()
returns a copy of the string in which all case-based characters have been lowercased.
.lower()
converts the first character of a string to capital (uppercase) letter
.capitalize()
returns an iterator that accesses the given sequence in the reverse order.
reversed
applies a function to all the items in an input_list.
map