Если вы ищете какой-либо ввод, вам не понадобится какое-то время, пока l oop, Python приостановит программу, пока она ожидает ввода от пользователя.
user_input = input("How are you?: (or press enter to quit) ")
user_input = ''.join(ch for ch in user_input if ch not in exclude)
user_words = user_input.split()
В качестве альтернативы, если вы хотите дождаться заданного значения c, вам необходимо установить условие, чтобы нарушить l oop.
ans = True
while ans != "Quit":
user_input = input("How are you?: (or press enter to quit) ")
user_input = ''.join(ch for ch in user_input if ch not in exclude)
user_words = user_input.split()
if user_input == "Quit":
ans = "Quit"
или
while ans:
user_input = input("How are you?: (or press enter to quit) ")
user_input = ''.join(ch for ch in user_input if ch not in exclude)
user_words = user_input.split()
if user_input == "Quit":
break