Not sure what those robot lines are doing so I commented them out since they are not related to the bug I found in your code. I got this to work by correcting your use of or
statements and using case insensitive check instead:
import pyttsx3
robot = pyttsx3.init()
while True:
# robot.say(input('Write something that you need me to say:\n'))
# robot.runAndWait()
n = (input('if you need to quit type : quit , if you need to write again press any button\n'))
if n.lower() == 'quit':
print("quitting...\n")
break
else:
print("continuing...\n")
continue
Explanation:
You wrote if n == 'Quit' or 'quit' or 'QUIT'
- which means "If n equals 'Quit' or if 'quit' is truthy (it is) or 'QUIT' is truthy (it is), proceed this way: break
" hence the termination you saw. If you wanted to use or
correctly, the expression would need to read:
if n == 'Quit' or n == 'quit' or n == 'QUIT