Key Terms Flashcards

1
Q

I/O

A

input output

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

Immutable

A

cannot change; strings are immutable ex. name = “Sam” , name[0] = ‘P’ returns TypeError

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

in-place algorithmn/function

(def., how to identify one)

A
  • prodcues an output in the same memory that contains the data; transforms an input without using extra memory
  • identification in python: usually will return None, but still modify the inputed data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Iterable

A

Object capable of returning its members one at a time

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

List Comprehension

A
  • create a list based on another list
  • create a list from a function

Example:

n_list = [x + 5 for x in [2,3,5] ]

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

snake_case v. CapWords

(when to use based on python style guide)

A

snake_case: used to define functions

CapWords: used to define classes

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

state diagram

A

Diagrams to give an abstract description of the behavior of systems.

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

String Interpolation

A

replacing a placeholder in a string with a designated corresponding value

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

When to use a dictionary ( 1 ); when to use a list ( 2 )?

A
  1. use dictionary when you want to store information, but do not need to know its exact index location and you do not need to sort.
  2. use list when you want to idex, slice, sort
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Hash Table Definition

A

A data structure that holds data in key, value pairs.

(Dictionary in Python)

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

hash value

A

numeric value of a fixed length that uniquely identifies data

dictionaries in python must be hashable, meaning they cannot be a mulipart key

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

recursive functions

A

self referencing function

example:

def fibonacci(n):

if n <= 1:

return n

return fibonacci(n-1)+fibonacci(n-2)

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

Garbage Collection

A

programming language manages memory automatically

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