base_string = '{} is my love in {}' print(base_string.format("Jack", 2018))输出结果为:Jack is my love in 2018使用大括号{}实现字符串的格式化