According to the following usage example of the class Mystery , which of the following method headers (with type contracts, without docstrings) are necessary to implement for Mystery to function as demonstrated below? Select all that apply. >> m = Mystery('hello') - Mystery('world') >>> m >>> print (m) hello-world >>> m.eject('Michael', 'Andi', 'Larry') ejected

New Perspectives on HTML5, CSS3, and JavaScript
6th Edition
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Patrick M. Carey
Chapter14: Exploring Object-based Programming: Designing An Online Poker
Section14.2: Visual Overview: Object Classes And Prototypes
Problem 7QC
icon
Related questions
Question
According to the following usage example of the class Mystery , which of the following method headers (with type contracts, without docstrings) are necessary to
implement for Mystery to function as demonstrated below? Select all that apply.
>>> m = Mystery('hello') - Mystery('world')
>>> m
<Mystery object at ex1024fc850>
>>> print(m)
hello-world
>>> m.eject('Michael', 'Andi', 'Larry')
ejected
O def _init_(self):
O def _init_(self, x: str):
O def _repr_(self) -> str:
O def _str_(self) -> str:
O def _sub_(self, other: Mystery) -> str:
O def _sub_(self, other: Mystery) -> Mystery:
O def _neg_(self) -> str:
O def _dash_(self, other: Mystery) -> Mystery:
O def eject(x: str):
O def eject(x: str, y: str, z: str):
O def eject(self, x: str, y: str, z: str):
O def _neg_(self) -> Mystery:
Transcribed Image Text:According to the following usage example of the class Mystery , which of the following method headers (with type contracts, without docstrings) are necessary to implement for Mystery to function as demonstrated below? Select all that apply. >>> m = Mystery('hello') - Mystery('world') >>> m <Mystery object at ex1024fc850> >>> print(m) hello-world >>> m.eject('Michael', 'Andi', 'Larry') ejected O def _init_(self): O def _init_(self, x: str): O def _repr_(self) -> str: O def _str_(self) -> str: O def _sub_(self, other: Mystery) -> str: O def _sub_(self, other: Mystery) -> Mystery: O def _neg_(self) -> str: O def _dash_(self, other: Mystery) -> Mystery: O def eject(x: str): O def eject(x: str, y: str, z: str): O def eject(self, x: str, y: str, z: str): O def _neg_(self) -> Mystery:
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT