2018年8月13日

字符串格式化

摘要: 1 #coding=utf-8 2 ''' 3 字符串格式化 4 ''' 5 6 #~~~~~~替换元素作用 7 #默认顺序替换 8 print('hello,{},{},{}'.format('z','c','zc')) 9 10 #使用关键字进行对应变量的替换 11 print('hello,{y},{x},{z}'.format(x='z',y='c',z='zc')... 阅读全文

posted @ 2018-08-13 11:12 DAY&DAY&UP 阅读(85) 评论(0) 推荐(0) 编辑

导航