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]
3 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]3 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
What is a burned edge ?
scoray [572]

Answer: IT IS A DARK FEATHERED EDGE AROUND AN IMAGE

Explanation:

8 0
4 years ago
Give a common business example that mimics the differences between a shared
Serhud [2]

An  business example that mimics the differences between a shared network segment and a dedicated network segment is that of connection of work station transmission.

<h3>What is Shared segment network?</h3>

In this type of network,  local area network or an aspect of the local area network is said to have a lot of workstations and the multiple workstations are linked by using a hub

Note that all the workstation do not need to share the network capacity with other workstations but  an  business example that mimics the differences between a shared network segment and a dedicated network segment is that of connection of work station transmission.

Learn more about network segment from

brainly.com/question/7181203

#SPJ1

6 0
2 years ago
Jack is writing a paragraph for a school assignment. He proofreads his paper and notices that he used the word, "then" many time
Lynna [10]

He should use a Thesaurus.

5 0
4 years ago
Read 2 more answers
How many country on earth​
Reika [66]

Answer:

195 countries

I think Soo

8 0
3 years ago
Read 2 more answers
¿Qué podría pasar si los avances tecnológicos cayeran en personas sin formación Ética-Moral?
timurjin [86]

Answer:

If technological advances fall on people without Ethical-Moral training, then life itself would be threatened as our humanity and environment would be destroyed.

Explanation:

Question:

What could happen if technological advances fell on people without Ethical-Moral training?

Morals: Morals refer to human behavior. The principles of right and wrong

Ethics: It is the body of rules and regulations that dictate the conduct of practitioners of a particular profession.

In terms of technology, ethics is viewed in two contexts; if the pace of technological innovation is benefiting the humanity or not; if it is severely empowering people while choking others in the process.

Technology: it is the application of scientific principles for practical purposes of human life. Technology when used properly improves the quality of life of people.

On one hand, technology in itself is said to be neither good nor bad. It is people who determine it's application. With this said, we can infer that if technology falls on the wrong hands, it could be disastrous.

On the other, some technologies like nuclear fission, genetic engineering exert enormous power that their existence raises ethical or moral questions.

The role of ethical training in technological advancement would be to monitor rather than control to ensure fair practices.

Now if technological advances fell on people without ethical-moral training, then life itself would be threatened:

- Cultural breakdown: Almost everything in our day to day lives would depend on technology

- Loss of jobs: this would happen when machines do the work of men

- Inequalities as those with initial access to it would be the rich thereby widening the gap between the rich and poor.

- Exploitation as competition towards Mastery and control increases

- Environmental degradation

5 0
3 years ago
Other questions:
  • Dan needs to ensure that delegates as well as those looking at his shared calendar information are unable to see the details of
    7·1 answer
  • Create a test that prompts a user to enter a 5-digit PIN in the main procedure and then calls Validate PIN procedure to validate
    12·1 answer
  • Write a program that lets a user enter N and that outputs N! (N factorial, meaning N*(N-1)*(N-2)*..\.\*2*1). Hint: Initialize a
    5·1 answer
  • What is an electronic path over which data can travel.
    7·1 answer
  • What two tools can be used to disable a service and to give a list of all currently running services, respectively?
    7·1 answer
  • Which examples are relevant sources for students to use in research?
    6·1 answer
  • If the code for JAVA is LCXC, what is the code for BASIC?
    12·1 answer
  • What is the type of data in the list [103, 405, 527, 396, 503]?
    7·2 answers
  • Create a function called sphereVolume that determines the volume of a sphere with a given radius and prints the result to the sc
    9·1 answer
  • After months of hard work, the big day has finally arrived, and your software will be produced and distributed. Which phase of t
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!