Double curly braces

Why do we use double curly braces here?

Other examples in the tutorial use single curly braces.

I feel confused even after reading the explanation saying that "Braces need to be escaped within a Python string, and we do this by using double quotes."
How do we know whether it is a Python string or not? Since almost all the commands in this tutorial is run by python like the one below.