Definitions Flashcards

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
Q

returns a set, that is the intersection of two other sets

A

intersection()

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

removes the items, in this set that are not present in other, speciied sets

A

intersection_updated()

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

returns whether two sets have a intersection or not

A

indisjoint()

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

returns whether another set contains this set or not

A

issubset()

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

returns whether this set contains another set or not

A

isuperset()

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

removes the elements to the set

A

pop()

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

removes the specified element

A

remove()

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

returns a set with the symmetric differences of two sets

A

symmetric_difference()

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

inserts the symmetric differences from this set and another

A

symmetric_difference_update()

33
Q

returns a set containing the union of sets

34
Q

update the set with union of this set and others

35
Q

removes all the elements from the dictionary

36
Q

returns copy of the dictionary

37
Q

returns a dictionary with the specified keys and value

A

fromkeys()

38
Q

returns the value of the value of the specified key

A

fromkeys()

39
Q

returns a list containing a tuple for each key value pair

40
Q

returns a list containing the dictionary’s key

41
Q

removes a list containing the specified keys

42
Q

removes the last inserted inserted key-value pair

43
Q

returns the value of the specified key. If the key does not exist:insert the key, with sepcified value

A

setdefault()

44
Q

updates the dictionary with the specified key-value pairs

45
Q

returns a list of all the values in the dictionary

47
Q

a block of code that can only executes when called
-where data can be passed
-can return data as a result

A

python function

48
Q

a keyword used to define a function

49
Q

a function definition

A

def sample_function():

50
Q

a fucntion call

A

sample_function()

51
Q

information passed into a function
-specified after the function name and inside the parenthesis
- seperated by comma

A

Arguments or args

52
Q

a function perspective that the variable inside the parenthesis in the function definition

53
Q

a function perspective that the value sent to the function when called

56
Q

the order of arguments does not matter

A

keyword arguments or kwargs

57
Q

a function call itself

58
Q

the three specific region where a variable can be accessed

A

local
nonlocal
global

59
Q

it is created inside the add_num function and can only be accessed within (local)

A

variable scoop

60
Q

a keyword to create a nonlocal variables
-used in nested functions when local scope is not defined

61
Q

what is called a random module that can be used to generate a random numbers

A

Random number(import random)

62
Q

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

63
Q

running a block of code based on a particular decesion

A

programming statements

64
Q

used to declare a block

A

identation

65
Q

used to test a specific condition, if the condition is true
-the condition can be any valid logical expression

A

if statement

66
Q

if the condition in the statement is false, it will execute the else statemnt

A

if-else statement

67
Q

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

A

elif statement

68
Q

allows the use of another if statment inside an if

69
Q

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

70
Q

can stop the loop before it has looped through all items

71
Q

can stop the current iteration of the loop and continue to the next

72
Q

returns a sequence of numbers from 0 increments by 1, and ends at a specified number

A

range() function

73
Q

block of statements to be excuted when the loop is finished

A

else in for Loop

74
Q

a loop inside the loop
-the inner loop will be executed once per iteration of the outer loop

A

nested loop

75
Q

for loop cannot be empty

A

pass statement

76
Q

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

A

while loop

77
Q

the loop can be stopped even if the while condition is still true

A

break statement

78
Q

stop the current iteration and continue with the next

A

continue statement

79
Q

can run a block of code when the condition is no longer true

A

else statement

80
Q

can run at least once
- pyhton does not have a built in of this
- but it is possible to emulate

A

do-while loop

81
Q

test if the condition is true or false and retuns the corresponding value, all in one of code

A

ternary opeartor/conditional operator