1st, what is in the References (Solution explorer), you can use as namespaces. If the namespace (like you wanted to use MessageBox) does not exist in the References, it cannot be used at all.
So 1st is the References (if there is no, you can simlpy add one) and 2nd is to add it into the projct on the top of it as namespase, and as you have figured it out by user self, simply that you dont need to write the whole path of the contols every time.
Come around every time you will encounter the problem. I was in the same position as you 2 years ago. :)
btw: if you get what you have wanted, please mark the thread as salved, so every one who is looking for a similar issue can get the answer.
And one more thing: Ask one thing at ones, if there is another bothering you, pleaser start another thread.
root = tkinter.Tk()
buttons=[i for i in range(10)]
#If specific button is pressed, output "YES"
for num in buttons: