Final Exam Flashcards

(10 cards)

1
Q

Difference between list and string

A

lists: hold values of any type
strings: sequence of characters

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

variable[3]

A

the value in index 3

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

[0,3]

A

values from index 0 to 2

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

if “value” in list

A

in looks for it in the list

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

states.pop(3)

A

removes value in index 3 from list

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

states.pop( )

A

removes last value in list

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

list.insert (0, value)

A

inserts value into given index, moves everything else down

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

variable[0]= value

A

replaces index 0 with given value

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

what range of numbers are generated by random ( )

A

greater than equal to zero and less than one

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