Final 3 Flashcards

1
Q

Trivia: What was ANOTHER song used for loops, specifically circular?

A

“Will It Go Around in Circles” - Billy Preston

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

What is an iterable?

A

It’s similar to a list, which a range function will iterate through up to a specified point

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

What is range(0,5) going through in the iterable?

A

0, 1, 2, 3, 4

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

What is range(5) going through in the iterable?

A

0, 1, 2, 3, 4
(if only one parameter is given for range, it is assumed that the first parameter is 0 and the one given is the second)

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

What is range(2,5) going through in the iterable?

A

2, 3, 4

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

Trivia: TV show that relates robustness to Santa Claus?

A

Johnny Carson - “Safe Santa has a velcro lap so your kid can’t fall off and hurt himself”

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

What is the first index of a list?

A

0

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

Trivia: What song was used to emphasize the point that the first index of a list is 0?

A

Imagine Dragons - “Zero”

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

What is used to convert one type of data into another?

A

cast

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

Trivia: What song was used to emphasize why the variables i, j, k, etc are used as counters in loops?

A

Bruce Hornsby - “The Way It Is”

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

Preferred method for printing out every index in the list “alist”

A

for i in range(len(alist)):
print(alist[i])

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

Trivia: Clip used as a reference to Python’s “Dark Side” (unintuitive, non-common sense way that changing i in a loop doesn’t work the way you expect it to)

A

John MacEnroe screaming “You cannot be serious” during a tennis match

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

What is a function argument?

A

A value or variable sent into the function

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

What is a function parameter?

A

The arguments the function will accept

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

Trivia: What was used as a reference for changing all the items in a list of sodas into Coke?

A

1971 Coke Commerical - “Hilltop”
“I’d like to buy the world a Coke”

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