In: Computer Science
Program Screen Shot:

Sample Output:

Program Code to Copy:
# let the previous function be named "atleastZero"
def atleastZero(number):
return number >= 0 # True if number>=0, False otherwise
# function for main
def main():
more = True # to control the while loop
running_sum = 0
while more: # loop only when more == True
user_input = float(input('Enter a number: '))
# check if user_input >= 0 by using the previous
function
if atleastZero(user_input):
running_sum = running_sum + user_input
else:
more = False
# after the loop stops
print('\nThe running sum is ',running_sum)
# call function main to run the program
main()
------------------------------------------------------------------------------
COMMENT DOWN FOR ANY QUERY RELATED TO THIS ANSWER,
IF YOU'RE SATISFIED, GIVE A THUMBS UP
~yc~