Write a class Example() such that it has a method that gives the difference between the size of strings when the '-' (subtraction) 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

Answers

Answer 1

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:-

Write A Class Example() Such That It Has A Method That Gives The Difference Between The Size Of Strings

Related Questions

SQLite is a database that comes with Android. Which statements is/are correct?
The content of an SQLite database is stored in XML formatted files because XML is the only file format supported by Android OS.
A SQLite database is just another name for a Content Provider. There is no difference as the SQLite implementation implements the Content Provider interface.
If an app creates an SQLite database and stores data in it, then all of the data in that particular database will be stored in one, single file.
A database query to an SQLite database usually returns a set of answers
To access individual entries, SQLite provides a so-called Cursor to enumerate all entries in the set.
This is yet another example of the Iterator pattern.

Answers

Answer:

1. Wrong as per my knowledge, SQLite may be an electronic database software that stores data in relations(tables).

2. Wrong. Content provider interface controls the flow of knowledge from your android application to an external data storage location. Data storage is often in any database or maybe it'll be possible to store the info in an SQLite database also.

3.Right. SQLite uses one file to store data. It also creates a rollback file to backup the stored data/logs the transactions.

4. Wrong. The queries are almost like a traditional electronic database system, the queries are going to be answered as per the conditions given and should return a group of answers or one answer depending upon the info and sort of query used.

5. Right. A cursor helps to point to one entry within the database table. this may be very helpful in manipulating the present row of the query easily.

State two ways of preventing virus attack on a computer.​

Answers

Answer:

updating the computer and having an anti virus on your computer

HELP ASAP PLZZZZZ

Question 35(Multiple Choice Worth 5 points)

(03.01 LC)


To write a letter to your grandma using Word Online, which document layout should you choose?


APA Style Paper

General Notes

New Blank Document

Table of Contents

Answers

Answer:

third one

Explanation:

To write a letter to your grandma using Word Online, you should choose the "New Blank Document" layout.

What is Word?

Microsoft Word is a word processing application. It is part of the Microsoft Office productivity software suite, along with Excel, PowerPoint, Access, and Outlook.

To write a letter to your grandmother in Word Online, select the "New Blank Document" layout. This will open a blank page on which you can begin typing your letter.

The "APA Style Paper" layout is intended for academic papers and includes formatting guidelines and section headings that a personal letter may not require.

In Word Online, "General Notes" is not a document layout option.

The "Table of Contents" feature generates a table of contents based on the headings in your document, but it is not a document layout option.

Thus, the answer is "New Blank Document".

For more details regarding Microsoft word, visit:

https://brainly.com/question/26695071

#SPJ2

Other Questions
Pacific Salmon is a valuable fish that shapes the lives of many people and fisheries along the Pacific Northwest, but many stocks are endangered. Congress recently enacted a statute creating a 10-person committee with the authority to research possible methods to preserve these endangered salmon stocks. The statute also gave the committee the authority to issue and enforce rules implementing the preservation methods the committee determined were appropriate. The statute provided that committee members would be appointed by the Fish and Wildlife Agency, an agency of the federal government within the Department of Interior. Is the statute unconstitutio According to general equation for conditional probability, if P(A^B) = 2/3 and P(B) = 3/4, what is P(A|B)? URGENT!! write a paragraph summarizing the central idea of sotomayor's speech. include key details that sotomayor uses to support her idea Animism and egocentrism represent limitations in the preoperational child's thinking in that they indicate an inability to: Bantam company calculated its net income to be $38,775 based on the unadjusted trial balance. The following adjusting entries were then made for: Salaries and wages owed but not yet paid of $395. Interest earned but not received from investments of $375. Prepaid insurance premiums amounting to $275 have expired.Unearned revenue in the amount of $805 has now been earned.Required: Determine the amount of net income (loss) that will be reported after the adjustments are recorded. Please help! I forgot how to do this. what sets one organization apart from others and provides the firm with a distinctive edge for meeting marketplace needs is known as _____ a target market by decentralization c competitive distinction d competitive advantage e core competency PLEASE HELP! Use the substitution method to solve the system of equations. A. (-30,11)B. (5,-3)C. (10,-5)D. (0,1) (a+1)(b+2)please help me!!! Can anyone help please? Lactase is an enzyme that is produced in the lining of the intestines. This enzyme helps the body speed up thebreakdown of carbohydrates that are found in dairy products, such as milk, yogurt, and cheese.Which general function does lactase perform? Evaluate the question in the photo attached please. ASAP A rectangle's length is three times as long as it is wide. Which expression represents the change in area if the width of the rectangle is increased by 1?1. 3x^22. 3x3. 3x^2+3x4. the area increases by 3 What system prepares the body for the fight or flight response in stressful situations All of the following factors contribute to the differences in complex trait risk predictions between different laboratories, EXCEPT ____________. differing methods of combining risk from multiple genetic variants selection of different genetic variants for risk determination different assessments of environmental factors genotyping of different variants Find the measure of the missing angle using the exterior angle sum theorm. The probability that an individual has 20-20 vision is 0.18. In a class of 12 students, what is the probability of finding five people with 20-20 vision?0.417 or 0.185 or 0.18 or 0.037 Which describes an effect of the prohibition If a window is to be 6 feet wide, how high should it be, to the nearest tenth of a foot, to be a golden rectangle Define the term akaryotes and give one example