msg="percent %.3f%%"%9.998832 print(msg)
Output 9.999% full 5 into a floating point number with f, %% means output a %
msg= " i am %(name)s toke " %{ " name " : " cat " } print (msg)
%s output string name usage is a dictionary
- left-aligned, + right-aligned
Add color \033[43; 1m string such as cat \033[0m
msg="i am \033[43;1m %(name)-4s \033[0m toke"%{"name":"cat"} print(msg)
The use of the separator sep is a simplified expression, print ( ' i ' , ' am ' , ' cat ' , sep= ' : ' )