Python Flashcards

1
Q

append()

A

Adds element to end of list

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

clear()

A

Removes all elements from list

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

count()

A

Counts elements in list

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

index()

A

Returns index of specified value

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

remove()

A

Removes 1st item of specified value

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

pop()

A

Removes element from the specified position

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

insert()

A

Inserts at a specified position

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

reverse()

A

Reverses the list

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

len()

A

Gives length

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

sort()

A

Sorts alphabetically

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

split(), in a string. Separates by what? What is the whole comma d.

A

Puts elements into a list. Separates by spaces. List = “this is a string”.split()

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

Print every other starts on

A

The first element

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

Sort and reverse commands issue

A

Does it in place so you can’t assign ot a new name because they only return none

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

range options

A

One number, or a range of numbers with steps. Ex…for n in range(start_num, end_number,steps)

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