day14 format使用

# format
#1. 不一一对应会报错
# tp1 = 'i am {}, age {}, {}'.format('seven',18,'alex')
# print(tp1)


# 2.按照索引取值
# tp1 = 'i am {1}, age {2}, {0}'.format('seven',18,'alex')
# print(tp1)


# 3.字典的形式传值
# tpl = 'i am {name},age {age},really {name}'.format(name = "seven",age =18)
# print(tpl)


# 4.

  

猜你喜欢

转载自www.cnblogs.com/styelfang/p/10180499.html
今日推荐