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]
3 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]3 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
Analyze the following code. II: public class Test { public static void main(String[] args) { System.out.println("Welcome to Java
Grace [21]

COMPLETE QUESTION

I. public class Test {

public static void main(String[] args){

System.out.println("Welcome to Java!");

}

}

II. public class Test { public static void main(String[] args) {System.out.println("Welcome to Java!");}}

Answer:

Both codes will compile and run and display Welcome to Java, but the code in II has a better style than I

Explanation:

When written codes, paying attention to proper coding styles and efficient memory management enables us to create programs that are highly efficient, coding styles refer to proper indentions and avoiding too lenghty lines of code (as is in code I), adding approprite comments etc.

8 0
3 years ago
Help meeeeeeeeeeeeeee please​
bija089 [108]

Answer:

Explanation:My explanation is above my comment :)

3 0
3 years ago
What is remote assistance?
Slav-nsk [51]

Answer:

Quick Assist, Windows 10 feature, allows a user to view or control a remote Windows computer over a network or the Internet to resolve issues without directly touching the unit. It is based on the Remote Desktop Protocol.

Explanation:

.....

3 0
3 years ago
List and briefly explain five activities for which a purchasing department normally has responsibility
melamori03 [73]
<span>Five activities for which a purchasing department normally has responsibility include: issuing their own purchase orders, meeting with different sales representatives, maintaining their own purchase records in accordance with state and federal law, administering contracts with sellers, and coming to a resolution regarding any purchasing problems that might arise.</span>
5 0
3 years ago
While a computer is running the operating system remains in memory. true or false?
MrMuchimi
While a computer is running the operating system remains in memory is true.
8 0
3 years ago
Other questions:
  • What is tuple and attribute of a relation​
    11·1 answer
  • Which one of the following is a functional requirement? Select one: a. None of the mentioned b. Robustness c. Maintainability d.
    10·1 answer
  • true or false? to change document properties, first tap or click file on the ribbon to open the properties view.
    6·2 answers
  • A computer program that senses when another computer is attempting to scan or access a computer or network is called an
    7·1 answer
  • IT professionals recognize that successful systems must be user-oriented, and users need to be involved, formally or informally,
    11·1 answer
  • A nonpipelined system takes 300ns to process a task. The same task can be processed in a 5-segment pipeline with a clock cycle o
    10·1 answer
  • Write a java program that would request user name, id number, and state the time the user has reported at work.​
    12·1 answer
  • When a person bullies someone using technology, it's called:
    9·2 answers
  • Which staff member takes a set of plans and supervises their construction?
    6·1 answer
  • Which element of the MakeCode Arcade interface represents an individual
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!