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
babunello [35]
4 years ago
13

Write a function that takes, as an argument, a list, identified by the variable aList. If the list only contains elements contai

ning digits (either as strings as non-negative integers), return the string formed by concatenating all of the elements in the list (see the example that follows).
Computers and Technology
1 answer:
Genrish500 [490]4 years ago
5 0

Answer:

The function is as follows:

def concList(aList):

   retList = ""

   for i in aList:

       if(str(i).isdigit()):

           retList+=str(i)

       else:

           retList = "Not digits"

           break;

   return retList

Explanation:

This defines the function

def concList(aList):

This initializes the return string to an empty string

   retList = ""

This iterates through aList

   for i in aList:

This converts each element of the list to an empty list and checks if the string is digit

       if(str(i).isdigit()):

If yes, the element is concatenated

           retList+=str(i)

If otherwise

       else:

The return string is set to "No digits"

           retList = "Not digits"

And the loop is exited

           break;

This returns the return string

   return retList

You might be interested in
A cathedral hull allows the boat to do what
Hoochie [10]
It allows power boats to have stability while cruising. The cathedral hull  is like a trimaran in terehat it has one main  and two side hulls stuck together so that has a somewhat square to rectangular shape and therefore exhibits greater stability than a single hulled boat. It became more popular with the advent of fibreglass boats in the 1960's and '70s.
5 0
3 years ago
A domain name points to a specific internet address known as a? A. Domain name B. User name C. URL D. IP address
hodyreva [135]
C, URL since the other options aren’t addresses at all
6 0
4 years ago
Ava calls tech support because she is unable to send information that a customer has requested. The tech support person tells he
Blizzard [7]

Answer:

Outlook as it is a common email aplication which may experience some issues

Explanation:

7 0
4 years ago
Parallelogram RSTU is rotated 45° clockwise using the origin as the center of rotation. On a coordinate plane, parallelogram R S
sesenic [268]
Hola me han dado un teléfono y que no se pueda ver el problema y me ha dado un teléfono y a la policía y le han dicho a las dos a las ido al médico a la gente que no han dado un paso de nada y a ver si se puede ver a las puertas del teléfono no me ha
6 1
3 years ago
Use the drop-down tool to select the word or phrase that completes each sentence.
bekas [8.4K]
A is anything that puts computer information at risk
4 0
3 years ago
Other questions:
  • Physical parts of components of a computer system is called
    9·1 answer
  • After modifying the /etc/default/grub file, what command should be run to rebuild the grub config files?​
    6·1 answer
  • Explain the role of the network layer and Internet protocol (IP) in order to make internetworking possible.
    8·1 answer
  • Write two scnr.nextInt statements to get input values into birthMonth and birthYear. Then write a statement to output the month,
    10·1 answer
  • What type of chart is good for single series of data​
    15·2 answers
  • 1. Accessing calendars, contact information, emails, files and folders, instant messages, presentation, and task lists over the
    12·1 answer
  • In some employment situations, not all personnel can immediately evacuate a work area per the eap. it may be that some equipment
    15·1 answer
  • Ms office suite comes with its own set of pictures in the​
    5·1 answer
  • An electronic element that stores data by changing its resistance based on the current that has passed through it (similar to RR
    5·1 answer
  • True or False: VLANs in cloud computing are most likely to be found on direct connections with a CSP.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!