An external variable has a specific type. Therefore the compiler will do type-checking when compiling. You can also assign a value to a global variable at run-time.
As WaltP said, Macros are very different. When a Macro is referenced, the compiler simply copies the value and pastes it in the code where you've used it (before compiling). It is equivalent to using a Find & Replace tool in a text editor. It does allow for some additional functionality however, such as #ifdef/#ifndef, #undef and functions. Although those are somewhat dependent on the compiler.
root = tkinter.Tk()
buttons=[i for i in range(10)]
#If specific button is pressed, output "YES"
for num in buttons: