1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
nika2105 [10]
3 years ago
9

Write a class Example() such that it has a method that gives the difference between the size of strings when the '-' (subtractio

n) symbol is used between the two objects of the class. Additionally, implement a method that returns True if object 1 is greater than object 2 and False otherwise when the (>) (greater than) symbol is used. For example: obj1
Computers and Technology
1 answer:
Ratling [72]3 years ago
7 0

Answer:

Here the code is given as follows,

Explanation:

class Example:

   def _init_(self, val):

       self.val = val

   def _gt_(self, other):

       return self.val > other.val

   def _sub_(self,other):

       return abs(len(self.val) - len(other.val))

def main():

   obj1 = Example('this is a string')

   obj2 = Example('this is another one')

   print(obj1 > obj2)

   print(obj1 - obj2)

main()

Output:-

You might be interested in
What is the HIPAA Privacy rule, and why does it affect IT professionals?
CaHeK987 [17]

Solution:

The HIPAA Privacy Rule establishes national standards to protect individuals' medical records and other personal health information and applies to health plans, health care clearinghouses, and those health care providers that conduct certain health care transactions electronically.

IT affects it by these ways:

The HIPAA Privacy Rule for the first time creates national standards to protect individuals’ medical records and other personal health information.

• It gives patients more control over their health information.

• It sets boundaries on the use and release of health records.

• It establishes appropriate safeguards that health care providers and others must achieve to protect the privacy of health information.

• It holds violators accountable, with civil and criminal penalties that can be imposed if they violate patients’ privacy rights.

• And it strikes a balance when public responsibility supports disclosure of some forms of data – for example, to protect public health.

This takes for patient.

• It enables patients to find out how their information may be used, and about certain disclosures of their information that have been made.

• It generally limits release of information to the minimum reasonably needed for the purpose of the disclosure.

• It generally gives patients the right to examine and obtain a copy of their own health records and request corrections.

6 0
3 years ago
1. Which tool is used for hardware to stand on to prevent static
GalinKa [24]

Answer:

An anti-static mat tool.

Explanation:

To prevent, static electricity from building up an anti-static mat tool is used. This is the tool that is used to prevent static electricity from building up. However, if you don't have the anti-static mat, an antistatic wrist strap can be used.

5 0
2 years ago
Why is remixing so popular with artists and other people online?
True [87]

Answer:

D.It is a way to be creative without having to construct totally new pieces.

Explanation:The answer is -D- because it is true. Remixing is a way of being creative, and you don't have to make completely new pieces.

4 0
3 years ago
Read 2 more answers
Dad always arrives home from work thoroughly exhausted​
Marina86 [1]
Yes plz explain your answer
6 0
3 years ago
you try to run the chkdsk utility from a command prompt but you keep getting an error message that you need to run it in elevate
DerKrebs [107]
When opening the CMD prompt from the RUN menu, right-click the option and select "Run as Administrator" in order to elevate permissions.
3 0
3 years ago
Other questions:
  • Positive and negative points of Computer and Information Systems Managers
    14·1 answer
  • What does the "e" in eSATA stand for?
    13·2 answers
  • _____ is the standard that enables wireless devices to access web-based information and services. world wide web tcp/ip ethernet
    5·1 answer
  • Dust buildup inside a desktop PC case can be managed effectively by ____.
    7·2 answers
  • Assume that name and age have been declared suitably for storing names (like "Abdullah", "Alexandra" and "Zoe") and ages respect
    5·1 answer
  • Which function can be used to insert the current date into a spreadsheet?
    9·1 answer
  • Are these even bangs
    10·2 answers
  • I GOT A 65% LAST TIME AND IM DOING RETAKE! PLEASE DONT FAIL ME THIS TIME
    8·2 answers
  • ......................... and ....................... are two ways to define the text in Inkscape.
    14·1 answer
  • Write a class definition line and a one line docstring for the class Dog. Write an __init__ method for the class Dog that gives
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!