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
Which is an advantage of a computer network?
stealth61 [152]
The answer is "networks allow computer to connect quickly and to share data or equipment". This is true because with a commuter network you can instantly share files to all the other computer by putting them of the network file storage center. This also allows multiple pieces of equipment to be used to complete one task that would usually take longer if a single computer did it
5 0
3 years ago
Read 2 more answers
A customer has an application that is used by enterprise customers outside of AWS. Some of these customers use legacy firewalls
madam [21]

Answer:

Switch the two existing EC2 instances for an auto scaling group and registered them with the network load balancer

Create a network load balancer with an interface in each subnet, and assign a static IP address to each subnet.

Explanation:

3 0
3 years ago
Count positive and negative number and compute the average. The program will have the user input an unspecified number of intege
Alla [95]

Answer:

The solution code is written in Python 3

  1. total = 0
  2. count = 0
  3. neg = 0
  4. pos = 0
  5. num = int(input("Enter an integer: "))
  6. while(num != 0):
  7.    total += num  
  8.    count += 1
  9.    if(num < 0):
  10.        neg += 1
  11.    else:
  12.        pos += 1
  13.    num = int(input("Enter an integer: "))
  14. print("The number of positives: " + str(pos))
  15. print("The number of negatives: " + str(neg))
  16. print("The total is " + str(total))
  17. print("The average is " + str(total/count))

Explanation:

Firstly, we create four variables, <em>total</em> , <em>count,</em> <em>neg</em> and <em>pos </em>(Line 1- 4). This is to prepare the variable to hold the value of summation of input integer (<em>total</em>), total number of input number (<em>count</em>), total negatives (<em>neg</em>) and total positives (<em>pos</em>).

Next, we prompt user for the first integer (Line 6).

Create a sentinel while loop and set the condition so long as the current input number, <em>num</em> is not equal to zero. the program will just keep adding the current <em>num</em> to total (Line 9)  and increment the count by one (Line 10).

if <em>num</em> smaller than zero, increment the <em>neg</em> by one (Line 13) else increment the <em>pos </em>by one (Line 15). This is to track the total number of positives and negatives.

Finally, we can display all the required output (Line 20 - 23) using the Python built-in function <em>print()</em>  when user enter 0 to terminate the while loop. The output shall be as follows:

The number of positives: 3

The number of negatives: 1

The total is 5

The average is 1.25

3 0
3 years ago
Natural language generation is focused on?
Mila [183]

While natural language understanding focuses on computer reading comprehension, natural language generation enables computers to write. NLG is the process of producing a human language text response based on some data input. This text can also be converted into a speech format through text-to-speech services.

<em>-</em><em> </em><em>BRAINLIEST</em><em> answerer</em>

6 0
3 years ago
1. (15%) Consider a computer system with three users: Alice, Bob, and Cyndy. Alice owns the file a, and Bob and Cyndy can read i
Fantom [35]

Answer:

answered in Image and explanation is given below.

Explanation:

CL is euqal to user permission on every file

ACL is equal to how permissions are defined for one life for example File a, read, write, execute.

4 0
3 years ago
Other questions:
  • When you first open a ms word document, what is the name of the document located on the first line of the document?
    12·1 answer
  • In Windows Vista, the Run command can be found in which application?
    6·1 answer
  • Which of the following should you NOT do when using CSS3 properties to create text columns for an article element? a. make the c
    12·2 answers
  • What Is The Oldest Known Analog Computer In The World?
    14·1 answer
  • An abstract method ____.
    6·1 answer
  • Freeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee points
    14·2 answers
  • JAVA
    10·1 answer
  • Q.No.3 b. (Marks 3)
    5·1 answer
  • Commercial technical data and commercial software:_________.
    11·1 answer
  • What types of character Microsoft Excel understand​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!