Solved

Which of the Following Statements Is False

Question 3

Multiple Choice

Which of the following statements is false?


A) The following xe "constructor expression"constructor expression creates a new object, then initializes its data by calling the class's __init__ method:
Account1 = Account('John Green', Decimal('50.00') )
B) Each new class you create can provide an __init__ method that specifies how to initialize an object's xe "class:data attribute"xe "data:attribute of a class"data attributes.
C) Returning a value other than Null from __init__ results in a TypeError. Null is returned by any function or method that does not contain a return statement.
D) Class Account's __init__ method below initializes an Account object's name and balance attributes if the balance is valid:
Def __init__(self, name, balance) :
"""Initialize an Account object."""
# if balance is less than 0.00, raise an exception
If balance < Decimal('0.00') :
Raise ValueError('Initial balance must be >= to 0.00.')
Self.name = name
Self.balance = balance

Correct Answer:

verifed

Verified

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents