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
erma4kov [3.2K]
3 years ago
14

Write the function longest that, given a nonempty list of strings, finds the longest even-length string that ends with ing. It t

akes a list of strings L as input and returns a string. If there are many longest strings, return the first. If there are no such strings, return the empty string (which clearly indicates that no string was found, since a valid string would need to be at least length 3).
Computers and Technology
1 answer:
lorasvet [3.4K]3 years ago
8 0

Answer:

  1. def longest(L):
  2.    for x in L:
  3.        if(len(x) % 2 == 0):
  4.            if(x.endswith("ing")):
  5.                return x  
  6.    return ""
  7. print(longest(["Playing", "Gaming", "Studying"]))

Explanation:

The solution is written in Python 3.

Firstly, create a function longest that takes one parameter L as required by question (Line 1).

In the function, create a for loop to traverse through each string in L and check if the current string length is even (Line 2 - 3). If so, use string endwiths method to check is the current string ended with "ing". If so return the string (Line 4-5).

At last, test the function by passing a list of string and we shall get the output "Gaming".

You might be interested in
Develop an sec (single error correction) code for a 16-bit data word. generate the code for the data word 0101000000111001. show
natita [175]

Answer:

010100000001101000101

Explanation:

When an error occurs in data bits, the SEC code is used to determine where the error took place. 5 check-bits are needed to generate SEC code for 16-bits data word. The check bits are:

C16=0, C8=0, C4=0,C2=0,C1=1

Therefore the SEC code is 010100000001101000101

7 0
3 years ago
Read 2 more answers
If you were teaching a fellow student to use software for the first time and the software had many built-in hotkeys, would you f
Liula [17]

Answer:

Hotkey commands

Explanation:

It would be easier and more efficient in the long run to use hotkeys.

5 0
3 years ago
A government agency is getting rid of older workstations. The agency will donate these workstations, along with other excess com
algol [13]

The simplest ways are being used to help eliminate the previously stored data, by deleting hard disc storage facilities with the same data wherever that used a sequence of all zeros.

<h3>What is a hard disc?</h3>

The "DoD Standard" is a term used during the data sanitizing industry and refers to DoD 5220.22-M, and the further discussion can be defined as follows:

The simplest ways are being used to help eliminate the previously stored data, by deleting hard disc storage facilities with the same data wherever that used a sequence of all zeros.

The sparging eliminates statistics to entirely delete the gravitational flux from electronic media.

Hard drives as well as other data storage devices, for example, computer tapes, retain magnetic data.

It could no longer be seen as storage after a disk is degaussed.

Therefore, the final answer is "Using the DoD 5220.22-M method and  Degauss media with a magnet".

Learn more about hard disc at:

brainly.com/question/13329582

#SPJ1

3 0
2 years ago
Remote authentication has always been a concern because the person is coming from a public network, and many companies require t
g100num [7]

Answer:

Incomplete Question.

I'll answer this question based on general terms

Explanation:

Two Factor Authentication, abbreviated as 2FA.

It is a type of authentication that requires the presentation of two credentials for access to personal data and information.

The credentials needed for a 2FA are

1. Either of the following; PIN, Password or Pattern

2. Your device or gadget which could be an ATM Card, Mobile Phone

3. Biometrics such as fingerprint, voice input

Number one is often referred to as "Something you know"

Number two is referred to as "Something you have"

Number three is referred to as "Something you are"

The 2FA doesn't require the three aforementioned credentials. It only needs just two of the credentials to provide its authentication.

8 0
3 years ago
Read 2 more answers
The____________ is becoming the preferred organizational structure for more andmore organizations with the passage of time.
mario62 [17]

Answer: Hierarchical structure

Explanation:

The hierarchical structure is the most preferred structure for an organisation. As more and more people join an organisation with the passage of time we can clearly see the different links between the persons and the their hierarchical level to the organisation. In this process it becomes easier to manage the people at the various levels.

7 0
3 years ago
Other questions:
  • What is a main cause of a virus on a computer
    6·1 answer
  • How do I change the selected cell to 20 pt
    8·2 answers
  • The exponential distribution is often used to model what in a queuing system?
    12·1 answer
  • Someone please help will mark as brainliest
    8·2 answers
  • I have a very quick question. So im applying for Early college and i need some future educational goals and maybe im just thinki
    6·1 answer
  • How is an interpreter different from a compiler?
    9·2 answers
  • :P 80 points to spare so i guess its free!!!!!!
    9·2 answers
  • It is a data being transported on a network​
    13·1 answer
  • Implement the ArrayMethod application containing an array that stores eight integers. The application should call the following
    12·1 answer
  • Write a recursive, string-valued method, reverse, that accepts a string and returns a new string consisting of the original stri
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!