Flashcards
Python Flash Cards
Flashcards do conjunto (75)
- 1(1, 2, 3, 4, 5)Tuples
A collection of ordered items
Mutable
Allows Duplicates - 2{'A', 'B', 'C', 'D', 'E',}Set
An unordered / unindexed collection
Mutable
Does not allow duplicates - 3[1, 2, 3, 4, 5]List
An ordered collection
Mutable
Allows duplicates - 4append()Adds an element at the end of a list
List - 5clear()Removes all items from a list
List, Dictionary, Set - 6copy()returns a copy of a list
List, Dictionary, Set - 7count()returns the number of elements of a specified value
List, Tuples, Strings - 8extend()Adds the elements of an iterable to the end of the current iterable
List - 9index()Returns the index of the first element with a specified value
List, Tuple, String - 10insert()Adds an element at the specified position
List - 11pop()Removes the element at the specified position
List, Dictionary, Set - 12remove()Removes the first item with the specified index
List, Set - 13reverse()Reverse the order of a list
List - 14sort()Sorts the list
List - 15{1: 'A', 2: 'B', 3: 'C'}Dictionary
An indexed collection that is not ordered
Mutable
Does not allow duplicates - 16fromkeys()Returns a dictionary with the specified keys and values
Dictionary - 17get()Returns the value of the specified key
Dictionary - 18items()Returns a list containing the a tuple for each key value pair
Dictionary - 19keys()Returns a list containing the dictionary's keys
Dictionary - 20popitem()Removes the last inserted key-value pair
Dictionary - 21setdefault()Returns the value of the specified key. If the key does not exist: insert the key, with the specified value
Dictionary - 22update()Updates the dictionary with a specified key-value pair
Dictionary - 23valuesReturns a list of all the values in the dictionary
Dictionary - 24add()Adds an element to a set
- 25difference()Returns a set containing the difference between 2 or more sets
Sets - 26differences_update()Removes the items in this set that are also included in another, specified set
Sets - 27discard()Removes the specified item
Sets - 28intersection()Returns a set that is the intersection of two other sets
Sets - 29isdisjoint()Returns True if two sets have an intersection
Sets - 30issubset()Returns True if another specified sets contains the current set
Set - 31issuperset()Returns True if the current set contains another specified set
- 32symmetric_difference()Returns a set with the symmetric differences of two sets
Set - 33symmetric_difference_update()Insert symmetric differences from this set and another
Set - 34union()Returns a set containing the union of two sets
Set - 35StringArrays of bytes representing unicode
Mutable
Doubles allowed - 36capitalize()Converts the first character to upper case
String - 37casefold()Converts string into lower case
- 38center()Returns a centered string
- 39encode()Returns an encoded version of the string
- 40endswith()Returns true if the string ends with the specified value
- 41expandtabs()Sets the size of the string
- 42find()Searches the string for a specified value and returns the position of where it was found
- 43format()Formats specified values in a string
- 44format_map()Formats specified values in a string
- 45isalnum()Returns True if all characters in the string are alphanumeric
- 46isalpha()Returns True if all characters in the string are in the alphabet
- 47isdecimal()Returns True if all characters in the string are decimals
- 48isdigit()Returns True if all characters in the string are digits
- 49isidentifier()Returns True if the string is an identifier
- 50islower()Returns True if all characters in the string are lower case
- 51isnumeric()Returns True if all characters in the string are numeric
- 52isprintable()Returns True if all characters in the string are printable
- 53isspace()Returns True if all characters in the string are whitespace
- 54istitle()Returns True if the string follows the rules of a title
- 55isupper()Returns True if all characters in the string are upper case
- 56join()Joins the elements of an iterable to the end of the string
- 57ljust()Returns a left justified
- 58lower()Converts a string into a lower case
- 59lstrip()Returns a left trim version of the string
- 60maketrans()Returns a translation table to be used in translations
- 61partition()Returns a tuple where the string is parted into three parts
- 62replace()Returns a string where a specified value is replaced with a specified value
- 63rfind()Searches the string for a specified value and returns the last position of where it was found
- 64rindex()Searches the string for a specified value and returns the last position of where it was found
- 65rpartition()Returns a tuple where the string is parted into three parts
- 66rsplit()Returns a right trim version of the string
- 67rstrip()Returns a right trim version of the string
- 68split()Splits the string at the specified separator, and returns a list
- 69splitlines()Splits the string at line breaks and returns a list
- 70startswith()Returns true if a string starts with the specified value
- 71swapcase()Swaps cases, lower case becomes upper case and vice versa
- 72title()Converts the first character of each word to upper case
- 73translate()Returns a s translated string
- 74upper()Converts a string into a upper case
- 75zfill()Fills the string with a specified number of 0 values at the beginning
Informações
- Descrição
- A collection of python terms, sorting algos, searching algos, trees, and graphs
- Criado por
- Ronnie Mosley
- Visualizações
- 10
- Avaliação