Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- len() -> Counts how many
- round() -> Rounds
- sum() -> Adds up values
- max() -> Find max in a series of values
- min() -> Find min in a series of values
- .split() -> To split apart a string, by default by space
- shuffle() -> Shuffles the elements of a list
- .index() -> Determine the index of the argument passed in a data structure
- ceil()
- math.isclose() -> Determine if two numbers are close to each other
- list.append(elem) -- adds a single element to the end of the list. Common error: does not return the new list, just modifies the original.
- list.insert(index, elem) -- inserts the element at the given index, shifting elements to the right.
- list.extend(list2) adds the elements in list2 to the end of the list. Using + or += on a list is similar to using extend().
- list.index(elem) -- searches for the given element from the start of the list and returns its index. Throws a ValueError if the element does not appear (use "in" to check without a ValueError).
- list.remove(elem) -- searches for the first instance of the given element and removes it (throws ValueError if not present)
- list.sort() -- sorts the list in place (does not return it). (The sorted() function shown later is preferred.)
- list.reverse() -- reverses the list in place (does not return it)
- list.pop(index) -- removes and returns the element at the given index. Returns the rightmost element if index is omitted (roughly the opposite of append()).
- if (condition):
- pass
- In a flow chart, consider every step the program has to take to get to the end. One start, one end
- https://stackoverflow.com/questions/46674581/wrap-list-around-in-python
- https://stackoverflow.com/questions/5180365/python-add-comma-into-number-string
Add Comment
Please, Sign In to add comment