Definitions Flashcards
(82 cards)
way of organizing data so it can be accessed more
Data structures
organize and group data according to type
containers
a collection of ordered, changeable, allows duplicate,
- a very flexible becasue it can contain different data types
List
ordered, unchangeable, allows duplicate
-a collection of Python objects like a list but are immutable
Tuple
unordered, unchangable, unindexed, does not allow duplicate
-used to include membership testing
-used to eliminating duplicate entries
Set
ordered, changeable, and does not allows duplicate
-holds a key:value pair
-cannot have two items with the same key
Dictionary
an object that can never change like strings, numbers and tuples etc.
key
adds an element at the end of the list
append()
removes all the elements from the list
clear()
returns a copy of the list
copy()
returns the number of the elements with the specified value
count()
add the elements of a list(or any iterable or can be enumerate into 1) to the end of the urrent list
extend()
returns the index of the first element with the specified value
index()
adds element at the specified position
insert()
removes the element at the specified position
pop()
removes the item with the specfied value
remove()
reverses the order of the list
reverse()
sorts the list
sort()
adds an elements to the set
add()
removes all the elements to the set
clear()
returns a copy of the set
copy()
returns a set containing the difference between two or more sets.
difference()
removes the items in the set that are also included in another, specified set
difference_updated()
removes the specified items
discard()