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
Get step-by-step solutions from verified subject matter experts
