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
tresset_1 [31]
2 years ago
10

Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive.

After the loop terminates, it prints out, on a single line and separated by a single space, the sum of all the even integers read and the sum of all the odd integers read. python
Computers and Technology
1 answer:
Paraphin [41]2 years ago
3 0

Answer:

The program to this question as follows:

Program:

#defining variable and assign value

odd=0  

even=0  

i=1  

print('Input 0 after inserting all number: ') #print message

while i>0: #define loop for check inserting and add all number

   i=int(input()) #input value by user end

   if (i< 0): #check value is not positive

       break

   if ((i % 2)==0and(i>0)): #check even number condition

       even=even+i #add even numbers

   if ((i % 2)!=0and(i>0)): #check odd number condition

       odd=odd+i #add odd numbers

print ('Sum of Even number:',even,'and','Sum of Odd number:',odd) #print value

Output:

Input 0 after inserting all number:  

1

2

3

5

7

0

Sum of Even number: 2 and Sum of Odd number: 16

 Explanation:

In the above python program, three variable is defined, that is "even, odd and i", in which "even and odd" variable assign value that is "0", and the variable i is used for inserting elements from user. In the next line a while loop is defined that inserts numbers in variable "i", in this loop, 3 if block is used that can be defined as follows:

  • In first if block variable "i", checks that value is non-positive number if this condition is true, it will break the loop.
  • In second if block this block check even number condition and add in even variable.
  • In third, if block this block check odd number condition and add in odd variable.  

End of the loop we use print function that prints the sum of even numbers and odd numbers.

You might be interested in
A mobile device you are troubleshooting is experiencing a sharp decrease in performance after an hour of operation. The user pow
Finger [1]

Answer: Close or disable all unused running apps.

Explanation: when unused apps keep runningon the device, it will make the device to keep lagging, thereby reducing it efficiency. But once those apps are disabled or closed and the system is probably restarted, the device will regain it efficiency back.

8 0
2 years ago
Discuss the inte Generation of computer, Inlith
ch4aika [34]

Generations of Computers

The computers of today find their roots in the second half of the twentieth century. Later as time progressed, we saw many technological improvements in physics and electronics. This has eventually led to revolutionary developments in the hardware and software of computers. In other words, soon the computer started to evolve. Each such technological advancement marks a generation of computers.

3 0
2 years ago
What is one of the main problems that can occur when implementing a large number of new systems within an organization?
attashe74 [19]

Trying to conduct business as usual while still training, learning, and migrating to a new system, is one of the main problems that can occur when implementing a large number of new systems within an organization. Linking up together problems that go hand in hand with a lengthy implementation process and the company conducting business as usual, this always becomes a very big issue. This practice of employees attending to their daily tasks of their main job and contributing to the software project at the same time can be detrimental and can cause software implementation to take much longer.

8 0
3 years ago
Tell four permanent icons on the desktop​
Alex777 [14]

Answer:

Desktop icons include Computer, your personal folder, Network, the Recycle Bin, Internet Explorer, and Control Panel. 1. Right-click an empty area of the desktop, and then click Personalize.

To arrange icons by name, type, date, or size, right-click a blank area on the desktop, and then click Arrange Icons. Click the command that indicates how you want to arrange the icons (by Name, by Type, and so on).

5 0
2 years ago
. Explain how semaphores are handled in embedded systems design
Readme [11.4K]

Answer:

 Semaphores carries the signal between the task and interrupts that does not carry any type of additional data in the embedded system. A semaphore is used as synchronization object and helps in maintain the value between zero and the specific higher value.  

It basically reduced the value each time and complete the semaphore object in the embedded system. Binary semaphores is the main type of semaphore that invoke activation of the task.

 

5 0
2 years ago
Other questions:
  • Climate is considered a(n) _______ limiting factor. (2 points)
    9·1 answer
  • ________ is used for supervisory messages at the internet protocol layer.
    10·1 answer
  • Write a program to calculate and return total surface area of a box using FUNCTION _END FUNCTION.​
    15·1 answer
  • A research team is studying parallel computing. They want to run parallel processes without having to use multiple processors. H
    15·2 answers
  • Which of the following is not regression test case? A. A representative sample of tests that will exercise all software function
    10·1 answer
  • What subsection of the Internet requires specialized browser to access and is frequently used by cyber criminals and underground
    10·1 answer
  • A junior administrator is having issues connecting to a router's console port using a TIA/EIA 568B standard cable and a USB seri
    5·1 answer
  • At what x position are the ellipses drawn??? thanks ♡​
    6·1 answer
  • JAVA
    5·1 answer
  • The BCD number for decimal 473 is( ). a) 111011010; b) 010011110011; c) 010001110011; d)0010110110​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!