标签:mat 显示 pytho pre form nbsp cpp highlight 八进制
format
>>> "{0} love {1}".format(‘I‘,‘python‘) ‘I love python‘ >>> "{a} love {b}".format(a=‘I‘,b=‘python‘) ‘I love python‘ 位置参数必须在关键字参数之前 >>> "{0} love {b}".format(‘I‘,b=‘pytnon‘) ‘I love pytnon‘ >>> "{a} love {0}".format(a=‘I‘,‘python‘) Error
>>> "{0:.1f}{1}".format(88.888,"GB")
‘88.9GB‘
>>> ‘%c‘%97 ‘a‘ >>> ‘%d %d %d‘%(1,2,4) ‘1 2 4‘ >>> ‘%e‘%12345 ‘1.234500e+04‘ #在八进制前显示(‘0o’),在16进制前显示(‘0x’)或(‘0X’)、 >>> ‘%#o‘%10 ‘0o12‘ >>> ‘%#x‘%10 ‘0xa‘ >>> ‘%#d‘%10 ‘10‘
标签:mat 显示 pytho pre form nbsp cpp highlight 八进制
原文地址:https://www.cnblogs.com/KIROsola/p/12371312.html