Data Types Flashcards

1
Q

What does the “round()” function allow you to do?

A

Round a number to a specified # of decimal places

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

Numbers with fractional parts are called?

A

Floats

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

Booleans represents two values which are what?

A

True or False

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

How can you switch the value of a boolean?

A

By using not

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

not True is equivalent to what?

A

False

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

not False is equivalent to what?

A

True

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

What are strings most commonly used for?

A

Represent text

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

How can you get the length of a string?

A

len()

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

What data type is a number in a string?

A

String

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

What does concatenate mean?

A

Link together in a chain or series

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

Can you multiply a string by an integer?

A

Yes

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

Can you multiply a string by a float?

A

No

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

When you multiply an int or float by a boolean w/ True value what does it return?

With value False?

A

The same int or float

Always 0

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

If you multiply a string by a boolean with value True what does it return?

With False?

A

True

An empty string (or len0)

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

False + False

A

0

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

True + False

A

1

17
Q

False + True

A

1

18
Q

True + True

A

2

19
Q

False + False + True + True + True + False

A

3

20
Q

Adding False is equivalent to adding what?

A

0

21
Q

Adding True is equivalent to adding what?

A

1