Filters
Question type

Study Flashcards

In computer science, abstraction is used for ignoring or hiding details that are nonessential.

A) True
B) False

Correct Answer

verifed

verified

To be considered equal, two lists must have the same length and the same items in each position, whereas the same sets must simply contain exactly the same items, but in no particular order.

A) True
B) False

Correct Answer

verifed

verified

Which of the following lists Python units of abstraction from smallest to largest?


A) classes, methods, functions, modules
B) functions, methods, classes, modules
C) modules, functions, methods, classes
D) modules, classes, methods, function

E) A) and B)
F) All of the above

Correct Answer

verifed

verified

By default, items in a sorted collection are visited in descending order when using a for loop iterator.

A) True
B) False

Correct Answer

verifed

verified

All collections are also iterable objects.

A) True
B) False

Correct Answer

verifed

verified

To traverse a collection's items, use the for loop.

A) True
B) False

Correct Answer

verifed

verified

In which type of collection does each item have many predecessors and successors, called neighbors?


A) linear
B) hierarchical
C) graph
D) unordered

E) A) and C)
F) B) and C)

Correct Answer

verifed

verified

What is the value of r after the following code executes? MyList = [ 2, 3, 5, 7, 11 ] YourList = list(myList) R = yourList is myList


A) [ 2, 3, 5, 7, 11 ]
B) True
C) None
D) False

E) C) and D)
F) None of the above

Correct Answer

verifed

verified

A line of customers waiting to get into a movie is an example of a hierarchical collection.

A) True
B) False

Correct Answer

verifed

verified

Which real-world item best represents a linear collection?


A) file system
B) organizational chart
C) stack of bricks
D) table of contents

E) A) and B)
F) B) and C)

Correct Answer

verifed

verified

The pop method is used to add items to a Python list.

A) True
B) False

Correct Answer

verifed

verified

A search operation is usually more efficient on a sorted collection than on an unsorted collection.

A) True
B) False

Correct Answer

verifed

verified

In computer science, collections are also called objective data types (ODTs).

A) True
B) False

Correct Answer

verifed

verified

What is the value of r after the following code executes? MySet = {2, 3, 5, 7, 11} YourSet = {5, 7, 2, 11, 3} R = yourSet == mySet


A) {5, 7, 2, 11, 3}
B) True
C) False
D) 0

E) B) and C)
F) A) and D)

Correct Answer

verifed

verified

When a shallow copy of a collection is made, only references to the items in the new collection are copied.

A) True
B) False

Correct Answer

verifed

verified

What is the value of newObject after the following code executes? NewObject = tuple("Hello")


A) ('H', 'e', 'l', 'l', 'o')
B) [ "Hello" ]
C) ("Hello")
D) [ 'H', 'e', 'l', 'l', 'o' ]

E) A) and D)
F) All of the above

Correct Answer

verifed

verified

What is the value of newList after the following code executes? NewList = list(range(9, 0, -3) )


A) [ 8, 5, 2 ]
B) [ 9, 6, 3, 0 ]
C) [ 9, 6, 3 ]
D) [ ]

E) None of the above
F) All of the above

Correct Answer

verifed

verified

What can a programmer do to prevent side effects from cloning mutable objects?


A) create a deep copy using a for loop
B) create a shallow copy using a type conversion
C) create a deep copy using a type conversion
D) use the assignment operator in stead of a type conversion

E) B) and D)
F) All of the above

Correct Answer

verifed

verified

Graph collections are organized in a parent/children relationship.

A) True
B) False

Correct Answer

verifed

verified

To determine equality of two collections, use the == operator.

A) True
B) False

Correct Answer

verifed

verified

Showing 21 - 40 of 50

Related Exams

Show Answer