Filters
Question type

Study Flashcards

If you wanted to overload the greater than or equal operator, what method name should you define?


A) __gte__
B) __gt__
C) __ge__
D) __geq__

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

Correct Answer

verifed

verified

What two terms are used for the methods that are used to observe or modify the state of an object, respectively?


A) accessors
B) ingressors
C) modifiers
D) mutators

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

Correct Answer

verifed

verified

What statement is an accurate description of the concept of inheritance in object-oriented programming?


A) Inheritance is the restricting of the manipulation of an object's state by external users to a set of method calls.
B) Inheritance is allowing a class to automatically reuse and extend the code of a similar but more general class.
C) Inheritance is the use of code that is capable of making changes to itself during the execution process.
D) Inheritance is allowing the several different classes to use the same general method names.

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

Correct Answer

verifed

verified

Objects in the natural world and objects in the world of artifacts can be classified using inheritance hierarchies.

A) True
B) False

Correct Answer

verifed

verified

What function do you use to save an object utilizing the pickle module?


A) pickle.save
B) pickle.jar
C) pickle.dump
D) pickle.store

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

Correct Answer

verifed

verified

The code x % y is actually shorthand for the code __mod__(x, y).

A) True
B) False

Correct Answer

verifed

verified

Inheritance allows several different classes to use the same general method names.

A) True
B) False

Correct Answer

verifed

verified

To reduce a rational number to its lowest terms, you first compute the greatest common divisor (GCD) of the numerator and the denominator, using Euclid's algorithm.

A) True
B) False

Correct Answer

verifed

verified

To overload an arithmetic operator, you just define a new method using the appropriate method name.

A) True
B) False

Correct Answer

verifed

verified

If the statements in the try clause raise no exceptions, the except clause is skipped and control proceeds to the end of the try-except statement.

A) True
B) False

Correct Answer

verifed

verified

Showing 41 - 50 of 50

Related Exams

Show Answer