1. str.format() Use
Use curly braces directly
print('My name is {},{} years old!'.format('xiaoming','28'))
Use formatting fields
print('My name is {0},{1} years old!'.format('xiaoming','28'))
Using variables
print('My name is {name},{age} years old!'.format(name='xiaoming',age='28'))
name='xiaoming'
print('His name is %s ' %name)