Definitions Flashcards

(82 cards)

1
Q

way of organizing data so it can be accessed more

A

Data structures

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

organize and group data according to type

A

containers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

a collection of ordered, changeable, allows duplicate,
- a very flexible becasue it can contain different data types

A

List

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

ordered, unchangeable, allows duplicate
-a collection of Python objects like a list but are immutable

A

Tuple

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

unordered, unchangable, unindexed, does not allow duplicate
-used to include membership testing
-used to eliminating duplicate entries

A

Set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

ordered, changeable, and does not allows duplicate
-holds a key:value pair
-cannot have two items with the same key

A

Dictionary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

an object that can never change like strings, numbers and tuples etc.

A

key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

adds an element at the end of the list

A

append()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

removes all the elements from the list

A

clear()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

returns a copy of the list

A

copy()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

returns the number of the elements with the specified value

A

count()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

add the elements of a list(or any iterable or can be enumerate into 1) to the end of the urrent list

A

extend()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

returns the index of the first element with the specified value

A

index()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

adds element at the specified position

A

insert()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

removes the element at the specified position

A

pop()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

removes the item with the specfied value

A

remove()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

reverses the order of the list

A

reverse()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

sorts the list

A

sort()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

adds an elements to the set

A

add()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

removes all the elements to the set

A

clear()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

returns a copy of the set

A

copy()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

returns a set containing the difference between two or more sets.

A

difference()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

removes the items in the set that are also included in another, specified set

A

difference_updated()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

removes the specified items

A

discard()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
returns a set, that is the intersection of two other sets
intersection()
25
removes the items, in this set that are not present in other, speciied sets
intersection_updated()
26
returns whether two sets have a intersection or not
indisjoint()
27
returns whether another set contains this set or not
issubset()
28
returns whether this set contains another set or not
isuperset()
29
removes the elements to the set
pop()
30
removes the specified element
remove()
31
returns a set with the symmetric differences of two sets
symmetric_difference()
32
inserts the symmetric differences from this set and another
symmetric_difference_update()
33
returns a set containing the union of sets
union()
34
update the set with union of this set and others
update
35
removes all the elements from the dictionary
clear()
36
returns copy of the dictionary
copy()
37
returns a dictionary with the specified keys and value
fromkeys()
38
returns the value of the value of the specified key
fromkeys()
39
returns a list containing a tuple for each key value pair
items()
40
returns a list containing the dictionary's key
keys()
41
removes a list containing the specified keys
pop()
42
removes the last inserted inserted key-value pair
popitem()
43
returns the value of the specified key. If the key does not exist:insert the key, with sepcified value
setdefault()
44
updates the dictionary with the specified key-value pairs
update()
45
returns a list of all the values in the dictionary
values()
46
47
a block of code that can only executes when called -where data can be passed -can return data as a result
python function
48
a keyword used to define a function
def
49
a function definition
def sample_function():
50
a fucntion call
sample_function()
51
information passed into a function -specified after the function name and inside the parenthesis - seperated by comma
Arguments or args
52
a function perspective that the variable inside the parenthesis in the function definition
parameter
53
a function perspective that the value sent to the function when called
argument
54
55
56
the order of arguments does not matter
keyword arguments or kwargs
57
a function call itself
recursion
58
the three specific region where a variable can be accessed
local nonlocal global
59
it is created inside the add_num function and can only be accessed within (local)
variable scoop
60
a keyword to create a nonlocal variables -used in nested functions when local scope is not defined
nonlocal
61
what is called a random module that can be used to generate a random numbers
Random number(import random)
62
a small anonymous function -can take any numbers of arguments, but can only have one expression (lambda arguments: expression) used as an used this if anonymous function is needed
lambda
63
running a block of code based on a particular decesion
programming statements
64
used to declare a block
identation
65
used to test a specific condition, if the condition is true -the condition can be any valid logical expression
if statement
66
if the condition in the statement is false, it will execute the else statemnt
if-else statement
67
checks multiple condition and executes the block of code that is evaluated to be true -optional like else -can contain multiple elif after an if
elif statement
68
allows the use of another if statment inside an if
nested if
69
used to iterating on a sequence (either list or a tuple etc.) -set of statemnts may be excuted once for each item, tuple, sets etc. -does not require an indexing varibale to set beforehand
for loop
70
can stop the loop before it has looped through all items
break
71
can stop the current iteration of the loop and continue to the next
continue
72
returns a sequence of numbers from 0 increments by 1, and ends at a specified number
range() function
73
block of statements to be excuted when the loop is finished
else in for Loop
74
a loop inside the loop -the inner loop will be executed once per iteration of the outer loop
nested loop
75
for loop cannot be empty
pass statement
76
it can execute a block of statement as long as it true - needs to define an indexing varibale increment ot decrement this variable or the loop will not end
while loop
77
the loop can be stopped even if the while condition is still true
break statement
78
stop the current iteration and continue with the next
continue statement
79
can run a block of code when the condition is no longer true
else statement
80
can run at least once - pyhton does not have a built in of this - but it is possible to emulate
do-while loop
81
test if the condition is true or false and retuns the corresponding value, all in one of code
ternary opeartor/conditional operator