Python % 汇总

python中用%代表格式符,表示格式化操作,常用的操作有%s,%d,%r等.
1.%s,%r,%d分别表示字符串以str(),rper(),以及十进制整数表示,%f表示结果为浮点型,更多见下表:
python中格式符的应用s,d,f以及format()的实例 - Mr.Cat - Mr.Cats blog

猜你喜欢

转载自blog.csdn.net/weixin_41151172/article/details/80027225