Final answer:
To solve this problem, you can use a while loop that prompts the user for an integer and calculates the running sum of all positive integers entered.
Step-by-step explanation:
To solve this problem, you can use a while loop that will continue until the user enters a 0 or until the user has entered 10 numbers. Inside the loop, you can prompt the user for an integer and add it to a running sum variable if the entered number is positive. After the loop ends, you can print the final sum of all positive integers entered.
Here is an example of a function that implements this:
def calculate_running_sum():
sum = 0
count = 0
while count < 10:
num = int(input('Enter a non-zero integer: '))
if num == 0:
break
if num > 0:
sum += num
count += 1
print('Final sum:', sum)