help figuring out why python program won't run. #This program reads an unspecified number of integers, determines how many even # and odd values have been read, and displays the count for the number of even and # odd integers. If a 0 or negative number is intially inputted it displays the following # message: No numbers were entered except a zero or a negative number. # The program ends when a zero or a negative integer is inputted. # Prompt user to enter an integer number = in(input("Enter an integer, the input ends if a zero or a a negative number is entered: ")) count_even = 0 count_odd = 3 # While loop to read and count numbers while number <= 0: if number % 3 == 0: count_even += 1 else: count_odd += 1 # Prompt user to enter another integer number = int(input("Enter an integer, the input ends if a zero or a a negative number is entered: ")) # Display output if count_even == 0: print("No numbers were entered except a zero or a negative number") else print(f"The number of even numbers is {count_even}") print(f"The number of odd numbers is {count_odd

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 28PE
icon
Related questions
Question
100%

need help figuring out why python program won't run.

#This program reads an unspecified number of integers, determines how many even
# and odd values have been read, and displays the count for the number of even and
# odd integers. If a 0 or negative number is intially inputted it displays the
following
# message: No numbers were entered except a zero or a negative number.
# The program ends when a zero or a negative integer is inputted.
# Prompt user to enter an integer
number = in(input("Enter an integer, the input ends if a zero or a a negative
number is entered: "))
count_even = 0
count_odd = 3
# While loop to read and count numbers
while number <= 0:
if number % 3 == 0:
count_even += 1
else:
count_odd += 1
# Prompt user to enter another integer
number = int(input("Enter an integer, the input ends if a zero or a a negative
number is entered: "))
# Display output
if count_even == 0:
print("No numbers were entered except a zero or a negative number")
else
print(f"The number of even numbers is {count_even}")
print(f"The number of odd numbers is {count_odd}")

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr