Exam 2 Flashcards
Iteration list
Variable following in
Iteration target
Variable following the in which is new
Loop patterns
Reusable code templates to solve commonly occurring problems.
Count
Count how many elements are in a list
Start with an initial value of zero and 1 to count
Count = count + 1
Sum
Add up all the numbers in a list
Start with zero and add the iteration variable
sum = sum + item
Accumulation
Combine elements into a single value (adding strings)
Map
Modify all elements of a list
A new list is formed
Filter
Remove elements from a list
Find
Get an element based on its value
found = None
Take
Remove elements past a certain point in the list
taking = True
Minimum/Maximum
Get the highest or lowest value in a list
!pwd
Print current working directory
!ls
List files in current working directory
!ls<path></path>
List files in the directory of the path
!cd<path></path>
Change the current working directory to that path