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
tatiyna
4 years ago
7

Create Python program code that will use a for loop to ask the user to enter four integers. It will count how many of the intege

rs are divisible by 2. The program will print each of the 4 integers and a message saying whether the integer is even or odd. The code will print the total number of even integers.
Computers and Technology
1 answer:
Triss [41]4 years ago
7 0

Answer:

"""

  Python program code that will ask the user to enter four integers.

  The program will print each of the 4 integers and a message saying whether the integer is even or odd.

  The code will print the total number of even integers.

"""

integer = []

count = 0

even = 0

while count < 4:

   entry = int(input ('Enter an integer: '))

   integer.append(entry)

   count = count + 1;

for num in integer:

   if num % 2 == 0:

       print( "The integer " + str(num) + " is even")

       even = even + 1

   else:

       print( "The integer " + str(num) + " is odd")

print( "The total number of even integers is " + str(even))

Explanation:

The while loop keeps executing provided the number of entry inputted is less than 4. Once it is up to 4, it stops.

The for loop is used to iterate over a list "integer", to test if the integers in it are even or odd.

The condition for even is the number whose remainder is zero after divided by 2. The symbol "%" used in the code, calculates the remainder after division. The numbers that have a remainder are odd.

You might be interested in
after installing a second hard drive what needs to be done to the hard drive and what do these 2 tasks do?
PIT_PIT [208]
To make it useable, the disk first needs to be subdivided into logical volumes, then formate, so that it is readable by the systems.
6 0
3 years ago
Which peripheral device is used to record sound?
faust18 [17]

he will need a microphone, it is a recording device.

8 0
3 years ago
Read 2 more answers
What: A challenging question on this module's material.
Alekssandra [29.7K]

Need further information!!!

6 0
3 years ago
When data are entered into a form and saved, they are placed in the underlying database as knowledge?
luda_lava [24]
The answer would be and is true.
7 0
3 years ago
Open source companies like Ethereum and Codius are enabling Smart Contracts using blockchain technology.
Olin [163]

Answer:

True

Explanation:

Ethereum uses Smart Contracts Blockchains and one of the programmers actually explained how it works at a DC Blockchain Summit.

3 0
4 years ago
Read 2 more answers
Other questions:
  • What is the next series of dragon ball super
    6·2 answers
  • The part of the computer that contains the brain, or the central processing unit, also knows as the
    5·1 answer
  • What are the features of Cobol language that make it suitable for programming business applications.
    6·1 answer
  • Jemima is reviewing her history report and notices that her headings are not formatted the same throughout the
    7·1 answer
  • What is the ability for a system to respond to unexpected failures or system crashes as the backup system immediately and automa
    8·1 answer
  • Complete the method, print Multiples(), that takes in a positive integer n, and another positive integer, max. Print out all the
    15·1 answer
  • Which term describes a visual object such as a picture a table or text box
    15·2 answers
  • he degree of operating leverage is equal to: Group of answer choices FC / OCF. VC / OCF. 1 FC / OCF. 1 VC / OCF. 1 Picture FC /
    9·1 answer
  • We have studied machine cycle in class. Suppose that each of the four modules of machine cycle is taking 2 seconds. If there are
    5·1 answer
  • It is possible to create a share that is invisible to users browsing the network simply by appending what character to the end o
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!