In the first example, we're using the format() function to insert the values of name and age into a string. The resulting string will contain the values of the variables in the correct places.
In the second example, we're using index-based placeholders to specify the order of the variables in the string.
In the third example, we're using named placeholders to make the code more readable.
In the fourth example, we're formatting a number (x) to two decimal places using the :.2f format specifier. The resulting string will contain the value of x with two decimal places.