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
The scope of a variable is __________________
Goryan [66]

Answer:

The scope of a variable is where it can be read or modified.

6 0
2 years ago
Lynn has created a quarterly sales report using a word processor. The document is confidential, and Lynn wants to secure it with
sweet-ann [11.9K]
Stop cheating



It’s b
3 0
3 years ago
How should a common data source, like social media comments, be categorized
Masja [62]

Answer:

unstructured data

Explanation:

Sources that are likely to give you unstructured data might be: Social media posts

4 0
2 years ago
Give a recursive (or non-recursive) algorithm to compute the product of two positive integers, m and n, using only addition and
LiRa [457]

Answer:

Multiply(m,n)

1. Initialize product=0.

2. for i=1 to n

3.      product = product +m.

4. Output product.

Explanation:

Here we take the variable "product" to store the result m×n. And in this algorithm we find m×n by adding m, n times.

6 0
4 years ago
If your DTP document contains watermarks on every page, where can you place them?
GaryK [48]
Under text and make it look like they belong
8 0
3 years ago
Read 2 more answers
Other questions:
  • An electronic resume is a plain-looking document. True of False?
    6·2 answers
  • How do you send a private message on facebook to someone who is not your friend?
    9·1 answer
  • In a formatted text file, ________ signal(s) the beginning and end of a formatting command.
    12·1 answer
  • Assume that x is a char variable that has been declared and already given a value . write an expression whose value is true if a
    8·1 answer
  • Which method of accessing FTP has the most limited capabilities?
    9·2 answers
  • You would use the _______ conditional formatting options when analyzing a worksheet in which you want to highlight the highest o
    13·1 answer
  • Cuando se introduce una fórmula en una celda primero que hay que introducir es
    13·1 answer
  • HELPPP I cand find my sound card/driver on my computer, and I cant hear anything, I have tried to update the audio driver, but w
    7·1 answer
  • Silicone rubber and urethane caulks generally give the ____________ overall performance for exterior building envelope applicati
    8·1 answer
  • The software/system that helps make sure the retail firm doesn't have a stockout is?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!