Data Types Flashcards

(16 cards)

1
Q

x = “apple”

A

str

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

x = 1

A

int

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

x = 7.5

A

float

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

x = True

A

bool

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

x = [“apple”, “banana”]

A

list

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

x = {“name”: “Bob”}

A

dict

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

x = (“apple”, “banana”)

A

tuple

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

x = {“apple”, “banana”}

A

set

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

what is a str

A

words surrounded by “” or ‘’

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

what is a int

A

a number with no decimals

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

what is a float

A

a number with decimals

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

what is a bool

A

True or False

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

what is a list

A

an ordered collection of data that can be changed and indexed and allows duplicates

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

what is a dict

A

an ordered collection of data that can be changed and doesn’t allow duplicates. can only be indexed with the key from the key:value pair

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

what is a tuple

A

an ordered collection of data that cannot be changed but can be indexed and allows duplicates

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

what is a set

A

an unordered collection of data that can be changed that is unindexed and doesn’t allow duplicates