Question
CREATE A FLOWCHART FOR THIS PYTHON PROGRAM #initial variables total = 0 countPositive = 0 countNegative = 0 #ask user how many sets of numbers
CREATE A FLOWCHART FOR THIS PYTHON PROGRAM
#initial variables
total = 0
countPositive = 0
countNegative = 0
#ask user how many sets of numbers to input
num1 = int(input("How many set of numbers would you like to enter: "))
#loop for taking input
for x in range(1, num1+1):
num2 = int(input(f"{x}. Enter number: "))
#calculating total
total += num2
#check if number is positive or negative
if (num2 >= 0):
countPositive += 1
elif(num2 <= 0):
countNegative += 1
average = total / num1
#print result
print()
print("The number of positives is ", countPositive)
print("The number of negatives is ", countNegative)
print("The total is ", total)
print("The average is ", round(average,2))
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started