Final 3 Flashcards
Trivia: What was ANOTHER song used for loops, specifically circular?
“Will It Go Around in Circles” - Billy Preston
What is an iterable?
It’s similar to a list, which a range function will iterate through up to a specified point
What is range(0,5) going through in the iterable?
0, 1, 2, 3, 4
What is range(5) going through in the iterable?
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)
What is range(2,5) going through in the iterable?
2, 3, 4
Trivia: TV show that relates robustness to Santa Claus?
Johnny Carson - “Safe Santa has a velcro lap so your kid can’t fall off and hurt himself”
What is the first index of a list?
0
Trivia: What song was used to emphasize the point that the first index of a list is 0?
Imagine Dragons - “Zero”
What is used to convert one type of data into another?
cast
Trivia: What song was used to emphasize why the variables i, j, k, etc are used as counters in loops?
Bruce Hornsby - “The Way It Is”
Preferred method for printing out every index in the list “alist”
for i in range(len(alist)):
print(alist[i])
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)
John MacEnroe screaming “You cannot be serious” during a tennis match
What is a function argument?
A value or variable sent into the function
What is a function parameter?
The arguments the function will accept
Trivia: What was used as a reference for changing all the items in a list of sodas into Coke?
1971 Coke Commerical - “Hilltop”
“I’d like to buy the world a Coke”