Regarding the .format() method, consider the following example:
print("{}, {} and {} are colors.".format("Red", "Blue", "Green"))
will output
Red, Blue and Green are colors.
It's also possible to use indexing (maybe this is not the right wording):
print("{0}, {1} and {2} are colors.".format("Red", "Blue", "Green"))
that would output the same thing.
However, he then proposed an alternative of declaring variables (again, probably this is not the right wording) like the following:
print("{r}, {b} and {g} are colors.".format(r="Red", b="Blue", g="Green"))
That again outputs the same result.
Is there any advantage of using variables like r, b and g inside the .format() method?
One thing I thought about it is that I could use these variables later on in the program but if I try to use them I get a NameError: name 'r' is not defined.