Course 2: Python for Data Science, AI & Development Flashcards

1
Q

Types

A

how python represents different types of data

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

what does bool(1) yield?

A

TRUE

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

what does bool(0) yield?

A

FALSE

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

expressions

A

type of operation the computers perform

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

what does a double slash (//) in a division operation do?

A

rounds to nearest whole number

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

variable

A

used to store values

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

how to assign a new valuable to existing variable

A

use : instead of =

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

what does int(true) yield?

A

1

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

if name=”Michael Jackson”, what does name[2] return?

A

“c”

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

if name=”Michael Jackson”, what does name[0:4] return?

A

“Mich”

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

if name=”Michael Jackson”, what does name[::2] return?

A

“McalJcsn”

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

if name=”Michael Jackson”, what does name[0:5:2] return?

A

“Mca”

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

\n

A

new line

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

\t

A

tab

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

\

A

\

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

print(r”Michael Jackson \ is the best”) returns?

A

Michael Jackson \ is the best”

17
Q

A=”Thriller is the sixth studio album”
B=A.upper()
B returns what?

A

“THRILLER IS THE SIXTH STUDIO ALBUM”

18
Q

A=’Michael Jackson is the best’
B=A.replace(‘Michael’,’Janet)
B returns what?

A

‘Janet Jackson is the best’

19
Q

tuples

A

ordered sequence written as comma-separated elements within parentheses and are immutable

20
Q

what does it mean to say a tuple is immutable?

A

not capable of change

21
Q

lists

A

ordered sequence similar to tuples written as comma-separated elements but within brackets and are mutable

22
Q

aliasing

A

multiple names referring to the same object