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
Minerals that contain the elements silicon and oxygen are called ______.
mojhsa [17]
Silcates are minerals with silicon bonded with oxygen.
7 0
3 years ago
What is the purpose of the Format Painter?
Oduvanchick [21]

Answer:

changes the formatting to be exact from what is copied to what should be

Explanation:

It happens to be the feature of the MS word that is applied to a style from one section of the document to another section. We first highlight the text with the thought of style like size, font, etc., and then click the format painter. The text that is highlighted next, gets transformed into the thought of style. And hence, the above option is correct.

5 0
3 years ago
In a spreadsheet, equations that use addition, subtraction, multiplication, and division operators, as well as values and cell r
timama [110]

The equations that uses addition, subtraction, multiplication and division operators and other values in a spread sheet is known as formulas. They are a way of having to provide symbols in means of expressing information regarding a mathematical formula that are being solved or showing its solution along with it.

4 0
3 years ago
_______ allow(s) you to apply colorful, eye catching designs to a presentation all at once.
astraxan [27]

What are some options of answers, or is there none?


4 0
3 years ago
Read 2 more answers
After reviewing device security you learn that a malicious user in an airport
NARA [144]

Answer:

Sniffing.

Explanation:

Data theft can be defined as a cyber attack which typically involves an unauthorized access to a user's data with the sole intention to use for fraudulent purposes or illegal operations. There are several methods used by cyber criminals or hackers to obtain user data and these includes DDOS attack, SQL injection, man in the middle, phishing, sniffing, etc.

Sniffing can be defined as a form of cyber attack in which a malicious user gains access to a private network with the intent of finding out what information is stored on the network.

A packet sniffer also known as a packet analyzer, is a computer software or hardware tool that can be used to intercept, log and analyze network traffic and data that passes through a digital network.

Basically, an unauthorized packet sniffer is used to steal user informations.

This ultimately implies that, sniffing typically involves monitoring and capturing internet traffic (data packets) that are transmitted through a private network in real-time by using a sniffing tool, which may either be a hardware or software.

In this scenario, a malicious user in an airport terminal seating area was able to connect wirelessly to a traveling employee's smartphone and downloaded her contact list. Thus, the type of attack that has taken place is referred to as sniffing.

4 0
3 years ago
Other questions:
  • When a browser makes a request for a static web page, the web server a. finds the HTML for the page and renders it b. renders th
    11·1 answer
  • Home communication involves controlling systems such as heating, cooling, and security.
    11·1 answer
  • What document type would be best to communicate sales items from a business to potential customer?
    12·1 answer
  • You are a network security administrator for a bank and you have noticed that an attacker has exploited a flaw in OpenSSL and fo
    9·1 answer
  • What are the five types of alignment in Word?
    12·2 answers
  • Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards
    9·1 answer
  • Que significa el término Informática?
    6·1 answer
  • Blending two or more colours is called​
    6·1 answer
  • If the old and new systems are operated side by side until the new system has proven itself, this type of system conversion plan
    11·1 answer
  • a data analyst is working with a spreadsheet that has very long text strings. rather than counting the characters themselves to
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!