In python please!! Write the definition of a function named countPos that needs integer values from standard input until there are none left and returns the number that are positive. The function must not use a loop of any kind.

Answers

Answer 1

Answer:

Explanation:

The following code is written in Python it doesn't use any loops, instead it uses a recursive function in order to continue asking the user for the inputs and count the number of positive values. If anything other than a number is passed it automatically ends the program.

def countPos(number=input("Enter number: "), counter=0):

   try:

       number = int(number)

       if number > 0:

           counter += 1

           newNumber = input("Enter number: ")

           return countPos(newNumber, counter)

       else:

           newNumber = input("Enter number: ")

           return countPos(newNumber, counter)

   except:

       print(counter)

       print("Program Finished")

countPos()

In Python Please!! Write The Definition Of A Function Named CountPos That Needs Integer Values From Standard

Related Questions

Two parter:

A.) What is wrong with the program segment below? The program does not contain syntax errors.

B.) Fix the programming error(s)

num = 1;

while (num < 9)
{
cout << num;
num = num - 1;
}

Answers

Answer:

the variable num is not declared so the compiler doesn't define it.

add int before num:

int num = 1;

while (num < 9)

{

cout << num;

num = num - 1;

}

now the code will run but it won't stop as it will never break the condition (num < 9).

Type the correct answer in the box. Spell all words correctly.
Alan maintains the efficiency of a printing plant by supervising plant operations and implementing safety procedures. What does he work as?
Alan is working as a _____________.

Answers

Answer:

Alan is a Maintenance Supervisor.

Explanation:

Answer:

printing plant manager

Explanation:

Drag the tiles to the correct boxes to compete the pairs. Identify the types of chemical reactions occurring in the chemical equations.

Answers

The question is incomplete. The complete question is :

Drag the tiles to the correct boxes to compete the pairs. Identify the types of chemical reactions occurring in the chemical equations.

combustion reaction , photosynthesis , respiration

water + carbon dioxide + sunlight → oxygen + glucose

methane + oxygen → water + carbon dioxide + heat

glucose + oxygen → carbon dioxide + water + energy

Solution :

The chemical reactions that is occurring in the following chemical equations are :

Photosynthesis

water + carbon dioxide + sunlight → oxygen + glucose

Plants uses the light energy from the sun in the presence of water and carbon dioxide produces food by the process of photosynthesis. It produces glucose and oxygen.

Respiration

glucose + oxygen → carbon dioxide + water + energy

The cellular respiration process produces ATP with the breakdown of the glucose and oxygen. During respiration process, carbon dioxide is obtained along with water and energy.

Combustion reaction

methane + oxygen → water + carbon dioxide + heat

Combustion reaction is a chemical reaction in which methane is the main ingredient. Combustion takes place as things burn in the presence to methane and oxygen to form carbon dioxide, water and heat.

List two examples of following types of communication

Answers

Verbal Communication. Verbal communication occurs when we engage in speaking with others. ...
Non-Verbal Communication. What we do while we speak often says more than the actual words. ...

Answer:

Explanation:

sign language is communication

touch is communication

Three types of common program errors are syntax, runtime, and logic. (5 points)
O True
O False

Answers

Answer:

True

Explanation:

True,My good sir/maam

also have a good day people !!

Answers

Answer:

Thx u2!!

Explanation:

Everyone have a good day!

Answer:

You too and thank you for 50 points!!

Explanation:

Match the roles to the task they perform.

gather requirements
create software framework
identify errors in the software
develop program code for software

Role

software architects
business analysts
programmers
testers

Answers

Software Architects: “develop program code for software”

Business Analysts: “gather requirements”

Programmers: “create software framework”

Testers: “identify errors in the software”

What is the difference between electrical and electronic devices?

Answers

Answer:

A difference is that the electrical devices makes the electrical energy into the other forms of energies, such as heat, light, sound, gravitational, and nuclear. . . The electronic device controls the flow of electrons for performing the task.

Answer:

the different between electrical and electronics devices is the electricity and the power of inside of some devices which are considered most powerful electronics from, because the difference is the battery.

Explanation:

i hope it helps ;)

You are the network administrator for a city library. Throughout the library, there are several groups of computers that provide public access to the internet. Supervision of these computers has been difficult. You've had problems with patrons bringing personal laptops into the library and disconnecting the network cables from the library computers to connect their laptops to the internet. The library computers are in groups of four. Each group of four computers is connected to a hub that is connected to the library network through an access port on a switch. You want to restrict access to the network so only the library computers are permitted connectivity to the internet. What can you do to fix this problem

Answers

Answer: Configure port security on the switch

Explanation:

Since there need to be a restriction on access to the network so that the library computers will be the only ones that are allowed connectivity to the internet, the thing that can be done to fix the problem is to configure a port security on the switch.

When a port security is configured, it helps in securing the network and this will in the prevention of unknown devices from being connected to the network.


what is the answer???​

Answers

Answer:

I think it should be C

Explanation:

A group of two or more computers that are link together.

Hardware failure, power outages, and DOS attacks will affect:

data confidentiality.

data integrity.

data verification.

data availability.

Answers

Answer:

The answer should be data availability

Columns are identified by numbers (1,2,3,4,5....) and Rows are identified by letters (A,B,C,D,E.....) True False

Answers

The answer would be true. Hope this helps you
Other Questions
The maximum height of the largest peaks in the Himalayan mountain range exceeds 8000 meters, while the highest mountain peaks of the rocky mountain are slightly above 4000 meters. what explains the difference between the maximum heights for the two mountain ranges? select all that apply.a) the rocky mountains are older and have been subjected to greater weathering erosionb) the rocky mountains have formed more recently and have been subjected to less geologic depositionc) the Himalayan mountains have formed long ago and have been subjected to more sedimentary depositiond) the Himalayan mountains have more recently formed from geologic uplift as two continental plates collidede) both mountain ranges were formed at the same time, but increased volcanic activity near the rocky mountains decreased their maximum elevation we bought that house last year it is ___ Scott eats an average 21000 calories each week he uses about 17500 calories each week pls helppppp only if u know the answr, brainliestttyou dont have to answr them all but ill appreciate it 7.8x = 32.76Show your work What is the height, in yards, of a cylindrical water tank that holds 1,884 cubic yards of water and has a diameter of 120 feet? Be sure to convert so you are using like units. This bicycle had two wheels of the same size. The alignment of the front wheel was fixed. There were no pedals, so the bike was propelled by pushing off with your feet and the bike was steered by leaning.strider bikecruiserhobby horsemountain bike natural selection vs artificial whats the difference Which of the following is an example of quid pro quo sexual harassment?A. Coworkers passing around inappropriate photos in the officeB. An employee leaving unwanted gifts for another employeC. A manager offering a position only if the employee accepts hersexual advancesD. An employee constantly asking another employee out There is a bag of marbles that contain 5 blues, 6 red, 3 black, and 2 yellow marbles. What is the probability that you select a blue marble Andrew Jackson a hero or a villain I need help with this problem Please help!!! Alfred Weagner noticed that the outline of many continents fit together, much like a puzzle leading him to propose the idea of a single super continental. This continental is known as-A ) EurasiaB ) Ind-AustraliaC ) AmericaD ) Pangaea Which statement is true about the lines 32=27 3 y - 2 x = 27 and 42=36 4 y - 2 x = 36 ? Which organelle of a cell functions similarly to the envelope of a virus and why? Use the figure below to answer the question. What is the measure of ABC? * how does pop culture affect our society? If the perimeter of a triangle is 31 ft and two of the side lengths are 15 ft and 10 ft, what is the length of the third side?A.16ftB.25ftC.6ftD.56ft Can someone help me with my math pls if your smart comment What is the domain of the following relation?