Phython Instant Flashcards

1
Q

How to write complex numbers in Python?

A

complex(a,b)

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

What does Python use for the square root of -1?

A

j

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

How is the floor divison operator depicted?

A

//

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

The … rounds the division output down to the next smallest integer.

A

floor division operator

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

The floor division operator … .

A

rounds the division output down to the next smallest integer

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

The floor division operator rounds the division output … to the next smallest integer.

A

down

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

‘not equal to’ in Python is

A

!=

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

‘greater than or equal to’ in Python is

A

> =

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

How to add an element to a list?

A

my_list.append(‘element’)

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

How to convert a list to an array?

A

z = array(my_list)

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

How to create a 5x5 array with zeros only?

A

c = zeros((5, 5), dtype=float)

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

Indices in python start with … .

A

0

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

How to remove an element of a list?

A

my_list.remove(‘element’)

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

How to delete the first element of a list?

A

del my_list(0)

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

A … can represent a vector.

A

one-dimensional arrray

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

A one-dimensional arrray … .

A

can represent a vector

17
Q

How to convert a list into an array?

A

my_array = array(my_list)

18
Q

A … can represent a matrix.

A

two-dimensional arrray

19
Q

A two-dimensional arrray … .

A

can represent a matrix