def welcome_main_function():
print("Hello! This program will run all the ratings from a survey and return avereges or see what areas is in need of improvements")
print("Enter the word 'return avereges' to calculate the avereges of the survey results.")
print("Or enter the word 'improvement' to see what areas needs to be improved.")
user_input = input("Enter here: \n")
if user_input == "return avereges":
sum_averege_func = response_values()
print(sum_averege_func)
avereges = get_averege_of_each_question(
SHEET.worksheet('responses'))
update_averege_worksheet(avereges)
pass
elif user_input == "improvement":
new_avereges = get_most_disliked_area(
SHEET.worksheet('responses'))
update_improve_worksheet(new_avereges)
pass
return user_input
def validate_user_input(data_input): """ Validate user input, and keeps the program running until user enters correct value """
try:
if data_input != "return avereges" or "improvement":
print("string not correct")
except ValueError:
print("check spelling")
data_input = welcome_main_function() validate_user_input(data_input)