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
Help plzzzzzzzzzzzzzzzzzzzzzzzzz
Reil [10]

B, Parallel ports are faster than serial ports.

A parallel port can move a set of 8 bits at a time on eight different wires, it uses a 25 pin connector, called a DB-25 connector, whereas a serial port only has a DB-9 connector.

7 0
3 years ago
_____ is a markup language designed to transport and store data on the Web. Group of answer choices Standard Generalized Markup
Kisachek [45]

<u>Extensible Markup Language (XML)</u> is a markup language designed to transport and store data on the Web.

Explanation:

  • Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable
  • Extensible means that the language is a shell, or skeleton that can be extended by anyone who wants to create additional ways to use XML.
  • Markup means that XML's primary task is to give definition to text and symbols.
  • It is a textual data format with strong support, Unicode for different human languages.
  • Extensible Markup Language (XML) is used to describe data.
  • The design goals of XML emphasize simplicity, generality, and usability across the Internet.
  • It is a text-based markup language derived from Standard Generalized Markup Language (SGML).
4 0
3 years ago
On a keyboard num lock and caps lock are both toggle keys. <br> a. True <br> b. False
tekilochka [14]
The answer is a) True
6 0
3 years ago
Which of the following ethical guidelines is best described as refraining from using granted authorizations for personal gain or
Artyom0805 [142]

Answer:

A. Do not use computer access or the Internet for unprofessional or inappropriate purposes.

7 0
3 years ago
What limited the possibilities of game development from a technical viewpoint?
lyudmila [28]

Answer:

1)Estimation of the game project

2) Development of Prototype

.

3) Reproduction Stage

4)Communication

5) Polish

Explanation:

The limited the possibilities of game development from a technical viewpoint are the reason why some of developers in gaming are diverting away into another area of computer technology. Some of these limiting factors are;

1):Estimation of the resources needed for the game development which is hard most especially for video games and some of the reasons is that the industry is fast changing. And there are things to be estimated such as time,is there any need bro change the code.

2)Development of Prototype of the game in other to

Know if a feature is valid can be a problematic process.and to know where to perform modifications.

3) Reproduction Stage:

This one of the main limiting problem in almost every game development , and this usually occur when a game ships, reproduction stage is skipped. And without proper preproduction, there will be no coherence in product.

4) Most of the Video games can be easily ruined by bugs and features that is badly executed. And this is where polishing comes in, polishing can be really demanding.

5 0
3 years ago
Other questions:
  • The ____ section of the project plan should describe the major project functions and activities and identify those individuals w
    7·1 answer
  • Write a Tip Calculator in code in VMware Fusion
    13·1 answer
  • What key should you press and hold to select and open multiple files at one time? Enter Alt Control Esc
    12·2 answers
  • This program outputs a downwards facing arrow composed of a rectangle and a right triangle. The arrow dimensions are defined by
    8·1 answer
  • When one user could perform a query to determine which recordings had a track length of four minutes or more, and another user c
    9·1 answer
  • The _____ handles the instructions for your computer to start up before the operating system is loaded.
    10·1 answer
  • If your computer won't connect to the internet, which of these is most likely to be the problem?
    8·1 answer
  • Write a line of code to convert time to hours. Remember there are 60 minutes in an hour. Then write a line of code to calculate
    9·2 answers
  • What game is this? help mee?
    8·2 answers
  • EASY What does the Backspace key do?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!