Week 7 Flashcards

1
Q

What is a first-class object?

A

An object that can be treated as a variable (assigned to variables, passed as arguments, returned from other functions)

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

What does the reduce() function do?

A

It applies a function of two arguments cumulatively to the items of a sequence, reducing it to a single output

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

What are higher order functions?

A

Functions that take other functions as arguments or return functions.

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

What is recursion?

A

When a function calls itself

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

What is declarative programming?

A

Programming that focuses on what the program should do

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

What is declarative programming?

A

Programming that focuses on what the program should do

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

What is imperative programming?

A

How

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

What are some benefits of functional programming?

A

Break complex problems into smaller steps

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

What are some benefits of functional programming?

A

Break complex problems into smaller steps

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

How is a conditional expression typically written?

A

<Consequent> if <predicate> else <alternative>
</alternative></predicate></Consequent>

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

Are number mutable or immutable in Python?

A

Immutable

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

What does DRY mean in programming?

A

Don’t Repeat Yourself

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

What does .pop() do in Python?

A

It returns and removes the last element (or the element at the index included in parentheses?)

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

What does .pop() do in Python?

A

It returns and removes the last element (or the element at the index included in parentheses?)

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