Exam 10: Object-Oriented Programming  

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

The ________ special method is called implicitly when you convert an object to a string with the built-in function xe "built-in function:str"xe "str built-in function"str, such as when you print an object or call xe "built-in function:str"xe "str built-in function"str explicitly.

(Multiple Choice)
4.9/5
(32)

To create a Decimal object, we can write: value = Decimal('3.14159') This is known as a(n) ________ expression because it builds and initializes an object of the class.

(Multiple Choice)
4.8/5
(36)

Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.8/5
(33)

Consider the following loop, which processes a list of employees: for employee in employees: Print(employee) Print(f'{employee.earnings():,.2f}\n') Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.9/5
(42)

Which of the following statements is false?

(Multiple Choice)
4.9/5
(44)

Which of the following statements is false?

(Multiple Choice)
4.8/5
(36)

Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.8/5
(36)

Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.9/5
(47)

Each new class you create becomes a new data type that can be used to create objects. This is one reason why Python is said to be a(n) ________ language.

(Multiple Choice)
4.8/5
(31)

Which of the following statements is false?

(Multiple Choice)
4.9/5
(33)

Which of the following statements is false?

(Multiple Choice)
4.7/5
(38)

Which of the following statements is false?

(Multiple Choice)
4.9/5
(40)

Class Time's properties and methods define the class's ________ interface, that is, the properties and methods programmers should use to interact with objects of the class.

(Multiple Choice)
4.9/5
(42)

Which of the following statements about a class's utility methods is false?

(Multiple Choice)
4.9/5
(35)

A read-only property has ________.

(Multiple Choice)
4.7/5
(40)

Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.7/5
(41)

Consider the following code which would set the hour of a Time object to an invalid value. wake_up._hour = 100 Which of the following statements is false?

(Multiple Choice)
4.8/5
(31)

Consider the following class Time __init__ method: def __init__(self, hour=0, minute=0, second=0): """Initialize each attribute.""" Self.hour = hour # 0-23 Self.minute = minute # 0-59 Self.second = second # 0-59 Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.8/5
(34)

Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.9/5
(33)

Python class ________ defines the special methods that are available for all Python objects.

(Multiple Choice)
4.9/5
(44)
Showing 21 - 40 of 42
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)