立即学习:https://edu.csdn.net/course/play/26755/340142?utm_source=blogtoedu
# method1
s='today is {day}, is {degree} degrees.'
print(s.format(degree=30,day='Sunday'))
# method2
s='today is {}, is {} degrees.'
print(s.format('Sunday',30))
#method3
s='today is {1}, is {0} degrees.'
print(s.format(30,'Sunday'))
# format中的参数也可以是对象