Unit 3 Flashcards

1
Q

What are the 7 essential programming elements?

A
  • Variables and tables
  • Computation
  • Input/Output
  • Selection
  • Repetition
  • Data Aggregation
  • Code aggregation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Elements of data aggregates first property is whether or not each element is exactly the same type as the others is called what?

A

Homogeneous

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

Elements of data aggregates first property is whether or not each element can be different types as the others is called what?

A

Heterogeneous

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

When addressing elements integer addressing is called what?

A

by number

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

When addressing elements, you address any string by what?

A

by name

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

What do you call aggregates whose size cannot be changed after being defined?

A

Fixed

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

What do you call aggregates whose size can be changed after being defined?

A

Dynamic

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

What character must be put at the end of every control construct in python?

A

:

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

In python what character is used in tuples?

A

parenthesis ()

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

In python what character is used in lists?

A

Square Brackets []

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

In python what character is used in dictionaries?

A

Curly Brackets {}

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

Why is Hello World often used in coding?

A

It is the smallest legal program that produces output.

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

In python What function can take any number of arguments but can only have one expression.

A

Lambda

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

What is the syntax for the lambda function?

A

lambda arguments : expression

*ex : x = lambda a : a +10
print (x(5))

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

What is included in conditional statements?

A

1: Initialization

2: Test

3: Update

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

What are functions that operate on other functions, either by taking them as arguments or by returning them?

A

Higher Order Functions

17
Q

What combines all of the values in a list into a single value?

A

The Reduce Function

18
Q

What takes elements of a list that meet a criteria and then creates a new list with those elements?

A

The Filter Function

19
Q

What preforms transformations on each element of a list, creating a new list with the transformed elements?

A

The Map Function

20
Q

What is the syntax for the map() function?

A

map(function, *iterables)

*ex: def multiply_by_2(item):
return item * item

21
Q

What is the syntax for the filter() function?

A

filter(function, *iterables)

*ex: def only_odd(item):
return item % 2 != 0

22
Q

What is the syntax for the reduce() function?

A

reduce(function, iterable[, initial])

*ex: def accumulator(initial, item ):
return initial + item