how to use % to format a string in python code example Example: python string format print("My name is {0} and I am {1} years old".format(name, age))