try using single qoute for the double quotes and double quoutes for the single quotes. Otherwise, yo can escape it. Another alternative is to use heredoc for a longer string., but for your situation something like this will do..
echo "' '";
root = tkinter.Tk()
buttons=[i for i in range(10)]
#If specific button is pressed, output "YES"
for num in buttons: