So I'm quite rusty on Python and I've done this before but I'm not sure how, and for the life of me I can't figure out what to search to come up with an answer.
My task is to allow the user to enter in as many numbers as they want and append those values to a list, then once they've finished adding the numbers they want, I present them with an average of all the numbers.
Everything is going perfectly but I'm just unsure how to repeat an if statement.
The area I need help on is between lines 94 and 104. I want to be able to repeat this over and over again until the user is finished, and then once they finish, run it one more time to show them the average.
#Activity 8
finish = False
numbers = []
while finish == False and len(numbers) > 0:
avg = sum(numbers) / len(numbers)
num = input("Enter the number you would like to add: ")
if finish == True:
print("Your final average is:", avg)
else:
finishCheck = input("Are you finished adding to the list ")
print()
if finishCheck == "No" or "no" or "n":
num = input("Enter the number you would like to add: ")
elif finishCheck == "Yes" or "yes" or "y":
finish == True
else:
print("Not a valid repsonse. ")
I know this is a pretty simple question but I would appreciate any help π