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
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
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}")
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images