Programming Final

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/73

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

74 Terms

1
New cards

COUNT counts ____ cells whereas COUNTA counts _____ cells.

a

non-blank , numeric

b

numeric , non-blank

c

numeric, alphanumeric

d

alphanumeric, numeric

numeric , non-blank

2
New cards

Which of the following would count cells in Column D but only when their values were larger than 5.

a

COUNTIF(D1:D10, '> 5')

b

COUNTIF(D1:D10, > 5)

c

COUNTIF(D1:D10, ">5")

d

COUNTIF("D1:D10", ">5")

COUNTIF(D1:D10, ">5")

3
New cards

The proper term for "10,15" in SUM(10, 15) is ____.

argument

4
New cards

Dragging a formula from the bottom edge (not the corner) will probably cause the formula to be ___

moved

5
New cards

Assume a formula in a cell B2 has the cell reference A$2. The formula is copied over to the cell C2 (one cell to the right). The formula in C2 will be ____.

a

A$2

b

B$2

c

B$3

d

C$2

B$2

6
New cards

Assume a formula in a cell B2 has the cell reference A$2.The formula is copied over to the cell B3 (one cell down).The formula in B3 will be ____.

a

A$2

b

A$3

c

B$2

d

B$3

A$2

7
New cards

If a formula containing the reference $B3 is copied over, what part of the formula will change

a

B will change

b

3 will change

c

B and 3 will change

d

Nothing changes

3 will change

8
New cards

A function in Excel can have multiple return values

False

9
New cards

To stop Random values from changing every time or to freeze random values, ______.

a

Copy the cell and Paste Values

b

Copy the cell and Paste Formula

c

Copy the cell and Paste Formatting

d

Lock Cells

Copy the cell and Paste Values

10
New cards

If you were looking up quiz scores by ID numbers using a VLOOKUP function, the id would need to be specified as the ____ argument.

a

first

b

second

c

third

d

fourth

first

11
New cards

In a VLOOKUP, the table_array should _____.

a

include the header row

b

have the first column be the first column of the worksheet

c

have the first column be the first column contain the lookup value

d

exclude data value columns not being used

have the first column be the first column containing the lookup value

12
New cards

Assume a formula in a cell B2 has the cell reference $F2. The formula is copied over to the cell C2 (one cell to the right). The formula in C2 will be ____.

a

$G2

b

$F3

c

$G3

d

$F2

$F2

13
New cards

Assume a formula in a cell B2 has the cell reference A2.The formula is copied over to the cell C3.The formula in B3 will be ____.

a

C3

b

B4

c

B3

d

C4

B3

14
New cards

The type for the value of "99.32" is

a

integer

b

float

c

real

d

string

string

15
New cards

What is the output?

number1 = 5

number1 = 10

#number1 = 2

print (1 + number1)

a. 6 b. 11 c. 3 d. 15

11

16
New cards

What is the output?

number1 = 6

number2 = 11

print (Number1 + number2)

a

6

b

11

c

17

d

Something else / error

Something else / error

17
New cards

Which of the following would generate an error?

a

numbers = ​[1, 2, 3]

numbers.append(4)

b

numbers = (1, 2, 3)

numbers.append(4)

c

numbers = ​[1, 2, 3]

numbers.remove(3)

d

numbers = (1, 2, 3)

numbers.remove​[3]

numbers = (1, 2, 3)

numbers.append(4)

numbers = (1, 2, 3)

numbers.remove​[3]

18
New cards

In Python to extract leading/trailing spaces, use ___.

a

trim

b

strip

c

partition

d

split

strip

19
New cards

title = "Netflix and Chill"

print ( title​​[0:3] )

a

Net

b

Netf

c

etfl

d

etf

Net

20
New cards

What does the following code result in?

name = Peter

print ( name​[2:] )

a

eter

b

ter

c

e

d

t

ter

21
New cards

number = 5

if number > 5 :print ("a")

else:print("b")

What is the output of the code above?

a

a

b

b

c

No output

d

Something else / error

Something else / error

22
New cards

Range (4) will give the range of numbers:

a

4

b

0, 1, 2, 3, 4

c

1, 2, 3, 4

d

0, 1, 2, 3

0, 1, 2, 3

23
New cards

Range (0, 5, 2) will give the range of numbers ___.

a

0, 2, 4

b

1, 3, 4

c

0, 1, 2, 3, 4

d

1, 3, 5

0, 2, 4

24
New cards

To get numbers

4, 2, 0

use:

a

range (4, 2, 0)

b

range (5, 2, -1)

c

range (4, -1, -2)

d

range (4, 0, -2)

range (4, -1, -2)

25
New cards

How do we add one element to a set?

a

append

b

add

c

update

d

insert

add

26
New cards

Which of the following can have duplicate elements?

a

lists

b

sets

c

tuples

lists & tuples

27
New cards

To join two sets, you can use

a

update

b

intersection

c

union

d

plus operator

update, intersection, union

28
New cards

Which of the following would correctly convert a list to a set?

a

numbers = set ( ​[1, 2, 3] )

b

numbers = list( ​[1, 2, 3] )

c

numbers = set ( (1, 2, 3) )

d

numbers = list( (1, 2, 3) )

numbers = set ( ​[1, 2, 3] )

29
New cards

Which of the following properly sets up a dictionary?

a

name = dictionary (name, id)

b

name = { name="Adam", id=2300 }

c

name = ( 'name': 'Adam', 'id': 2300 )

d

name = { 'name': 'Adam', 'id': '2300' }

name = { 'name': 'Adam', 'id': '2300' }

30
New cards

Which of the following is the ideal candidate for using dictionaries?

a

A series of scores for an uncertain number of students

b

Data about one student

c

Data about a number of students

d

Series of logically related values that can be described with a name or a label

b

Data about one student

d

Series of logically related values that can be described with a name or a label

31
New cards

Using the following code, how will you print only the name?data = { 'name': 'Adam', 'id': '2300' }

a

print ( data.name)

b

print ( data​[name])

c

print ( data​['name'])

d

print ( data!name)

print ( data​['name'])

32
New cards

person = {"name": "Fred", "id": "23423" }

for each_item in person:

print( person​[each_item] )

What values would get printed out?

a

name Fred

b

name id

c

Fred 23423

d

id 23423

Fred 23423

33
New cards

If you want to be able to have items in a data structure ordered by index numbers and be able to remove some elements later on as well, you would choose ____.

a

tuples

b

lists

c

dictionaries

d

sets

lists

34
New cards

You are importing customer data from 4 sources. If you want a non-repetitive listing of only those states that your customers are in, you should import or copy customer data into ____.

a

tuples

b

lists

c

dictionaries

d

sets

sets

35
New cards

Assume, you have the following data about one Amazon product: Amazon ID Number, Product Name, Product Rating, Number of Reviews

What data structure is this data best suited to?

a

tuple

b

list

c

set

d

dictionary

dictionary

36
New cards

Which of the following keywords creates a new function?

a

create

b

function

c

define

d

def

e

method

def

37
New cards

The purpose of keyword arguments is _____.

a

to allow specification of arguments out of order by using argument names

b

to allow specification of arguments in order but using argument names

c

to allow specification of arguments out of order without using argument names

to allow specification of arguments out of order by using argument names

38
New cards

When a function returns a value, it ______.

a

prints on the output screen

b

prints within the function

c

is given back to the caller function invisibly

d

is visibly seen on the output screen

is given back to the caller function invisibly

39
New cards

Which of the following are true about return values?

a

A function can return only one value

b

A function can return multiple values

c

A function can return only one value, which can in turn contain multiple values

a

A function can return only one value

c

A function can return only one value, which can in turn contain multiple values

40
New cards

To specify unlimited number of parameters in a function, use _____

a

( *lots_of_parameters )

b

( ​[ ]lots_of_parameters )

c

( lots_of_parameters​[ ] )

d

( lots_of_parameters* )

( *lots_of_parameters )

41
New cards

def function_name ( *lots_of_values ):

lots_of_values is a _____.

a

list

b

tuple

c

parameter

d

argument

tuple & parameter

42
New cards

def power(base, exponent):

base = 2

exponent = 3

return base * exponent result = exponent * base

return result

answer = power (3, 2)

print(answer)

a

6

b

8

c

9

d

Some sort of an error

8

43
New cards

A Pandas series is most similar to ____

a. a row of data

b. a column of data

c. a table of data

a column of data

44
New cards

print( data​['100'])

The line of code above will print:

a

Data at row 100

b

Data at column 100

c

Data with index 100

d

string literal '100'

data with index 100

45
New cards

A Pandas DataFrame is most similar to ____

a. a row of data

b. a column of data

c. a table of data

a table of data

46
New cards

How would we look up how many null values there are in the dataframe?

a

tail()

b

head()

c

nulls()

d

info()

info()

47
New cards

A Series in Pandas likely contains ____.

a. single row and multiple columns

b. single column and multiple rows

c. single column and single row

d. multiple rows and multiple columns

single column and multiple rows

48
New cards

To look at column headers for a DataFrame, you can use ___

a

info()

b

head()

c

tail()

d

headers()

a

info()

b

head()

c

tail()

49
New cards

A query function selects ____ from a data frame.

a

a subset of rows

b

a subset of columns

c

a subset of rows and a subset of columns

a subset of rows

50
New cards

A query is run on a DataFrame df. The result of the query are stored in a variable, df2.

df2 will ____.

a

have the same number of rows and columns as df.

b

have the same rows but fewer columns as df.

c

have the fewer rows but same columns as df.

d

have same or fewer rows AND same columns as df.

have same or fewer rows and same columns as df

51
New cards

If you want to make changes to the original dataframe, use ___.

a

original()

b

original = True

c

inplace = True

d

original = False

inplace = True

52
New cards

Column names with spaces should be enclosed in ____ within Pandas queries.

a

back quotes ``

b

single quotes ' '

c

double quotes " "

d

Brackets ​[ ]

back quotes ``

53
New cards

Query function modifies the data frame and converts it to contain a subset of the data

False

54
New cards

A DataFrame ALWAYS has rows and columns

a. True - it's two dimensional

b. False - if there is only one cell, then that's just one cell!

True - it's two dimensional

55
New cards

How would we delete all the rows with invalid cell data?

a

deletena

b

dropna

c

deletenull

d

dropnull

dropna

56
New cards

How would we drop a row that has a value "adf2234" at index row 26?

a

df.dropna(26)

b

df.dropindex(26)

c

df.drop(index=26)

d

df.drop(index=27)

df.drop(index=26)

57
New cards

For a student dataframe that contains student info, the names column has student names.

student_df​['name'].str.contains("jr.")

What will this code return or result in?

a

One column of names containing only those rows with "jr." in the name.

b

A data frame of rows and columns, containing only those rows with "jr." in the name

c

One series of boolean values indicating which rows have "jr." in the name

d

A data frame of row and columns, contain boolean values indicating which rows have "jr." in the name

One series of boolean values indicating which rows have "jr." in the name

58
New cards

How do you EDIT cell at row 26 and column 'ABC'?

a

df ​[26, 'ABC'] = value

b

df ​[ 'ABC', 26] = value

c

df.loc ​[ 'ABC', 26] = value

d

df.loc ​[26, 'ABC'] = value

df.loc ​[26, 'ABC'] = value

59
New cards

is_empty = True

The data type of 'is_empty' variable is ____.

a

string

b

boolean

c

int

d

N/A - it doesn't have a type

N/A - it doesn't have a type

60
New cards

A(n) _____ name is not followed by parentheses in Python.

a

function

b

property

c

variable

d

attribute

property, variable, attribute

61
New cards

Which of the following is FALSE?

a

A function can have two return values

b

A function can be recognized using parentheses

c

A function can return a list of values

d

A function can have two parameters

a function can have two return values

62
New cards

Arguments MUST be provided in the order listed in a method definition

a

True - they must match each parameter in the proper sequence without exception

b

False

c

Mostly True.... but you can use kwargs to provide arguments in any order.

Mostly True.... but you can use kwargs to provide arguments in any order.

63
New cards

For a tab-delimitted file, how would you specify that the values are delimited using a tab character?

a

separator = 'tab'

b

tab = '\t'

c

separator = '\t'

d

sep = '\t'

sep = '\t'

64
New cards

To find unique records, use ___

a

df​[column].unique

b

df​[column].unique()

c

df.unique(column)

df​[column].unique()

65
New cards

Write one line of code for a data frame, df that changes the value for the Name column at row 5 to 'Mike'.

df.loc​[5,'Name']='Mike'

66
New cards

df​[column].isna() will return you ____.

a

DataFrame

b

Series of 0 or 1

c

Series of Booleans

d

DataFrame of Index numbers and Booleans

series of booleans

67
New cards

To see data from rows 10 to 15 in data frame, df, you would use: _____.

a

df.loc(10, 15)

b

df​[10: 15]

c

df​[10, 15]

d

df.location​[10, 15]

df​[10: 15]

68
New cards

df.loc​[5, 'Name'] = 'Mike'

df​['Name'].replace('Mike', 'Sam')

print ( df.loc​[5, 'Name'] )

What is the output?

a

Mike

b

Sam

c

NaN

d

No output

Mike

69
New cards

Back quotes are REQUIRED for column names within a query

False

70
New cards

How can you get index numbers for all the rows of a data frame?

a

df.index()

b

df​['index']

c

df.index

d

df​[index]

df.index

71
New cards

You can supply multiple column names (col1, col2) to the drop function using

a

.drop( columns = "col1, col2")

b

.drop( columns = "​[col1, col2]")

c

.drop( columns = ​[col1, col2])

d

.drop( columns = ​['col1', 'col2'] )

drop( columns = ​['col1', 'col2'] )

72
New cards

Measures are typically ____.

a

discrete

b

continuous

continuous

73
New cards

A product category with values such as "Office", "Home", "Kitchen" would be a ____ in Tableau.

a

measure

b

dimension

dimension

74
New cards

Price would be classified as a ___ in Tableau.

a

measure

b

dimension

measure