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
Artemon [7]
2 years ago
6

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 = Example('this is a string') obj2 = Example('this is another one') print(obj1 > obj2) False print(obj1-obj2) 3
Computers and Technology
1 answer:
Mariulka [41]2 years ago
3 0

Answer:

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()

\color{red}\underline{Output:}

You might be interested in
The encapsulation unit on the presentation layer of the osi model is
Zielflug [23.3K]
<span>The encapsulation unit on the presentation layer of the OSI model is the Data link layer (2).</span>
7 0
3 years ago
I've this assignment due before 7 am. Please help, me.
Alenkasestr [34]

Answer:

An observation: Java does not support true multi-dimensional arrays; rather, it supports 1-dimensional arrays, where each element can itself be another 1-dimensional array. The difference is the way memory is allocated, where a[i][j] differs from a[i,j].

Explanation:

5 0
3 years ago
There is no need to schedule video calls ahead of time; they can be used the same way as
UNO [17]

Answer:

The answer to this question is "True".

Explanation:

The term video calling is part of communication. In this type of communication will be used in every place like house, office for video conferencing, etc. It was developed in 1968 by AT&T's Bell Labs. It works on internet.This type of calling we can face to face communicate means, we watch the person. In the video calling, there is no need for a schedule it is used as a phone call.  

6 0
2 years ago
Which one of the following pieces of information would be allowed as part of a limited data set?
Inessa05 [86]
Phone number would be allowed
6 0
3 years ago
Define graphics packaging​
Sav [38]

Answer:

"A graphics package is an application that can be used to create and manipulate images on a computer. There are two main types of graphics package: painting packages."

Explanation:

i looked it up like a normal person

jeez does nobody use google on here lol

4 0
3 years ago
Other questions:
  • CompX Inc. is an online retailer of electronic products, including laptops and tablets. The company is known for its unique appr
    15·1 answer
  • At age 16 Cheyanne just got her drivers license
    5·2 answers
  • Bluetooth © and Wifi are two examples of transmission protocols. Which of the following statements about them is true?
    9·1 answer
  • Which one of the following business names would be rated Incorrect for name accuracy? Answer McDonald's McDonald's H&amp;M McDon
    14·1 answer
  • Blank are back and forth movement of matter that create sound​
    15·1 answer
  • 3.17 (LAB) Ch 5 Warm up: Drawing a right triangle (Python 3) This program will output a right triangle based on user specified h
    10·1 answer
  • ¿Es lo mismo hablar de tecnología que de computadora?
    12·1 answer
  • The most common markup language used with web pages is ___________ Question 4 options: A. HTML B. VRML C. Javascript
    13·2 answers
  • What starts with p and ends with orn
    15·2 answers
  • While working in a group of two the members are not getting along. You bring the two members together so they can discuss this i
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!