str1 ="hello {}! my name is {}.".format('world','python')print(str1)# hello world! my name is python.
str2 ="hello {1}! my name is {0}.".format('python','world')print(str2)# hello world! my name is python.
str3 ="hello {hello}! my name is {name}.".format(hello="world", name="python")print(str3)# hello world! my name is python.