python - string 格式化比较

“Old-school” String Formatting in Python

Before Python 3.6, you had two main ways of embedding Python expressions inside string literals for formatting: %-formatting and str.format(). You’re about to see how to use them and what their limitations are.

 

Option #1: %-formatting

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

posted @ 2021-10-09 10:11  xman888  阅读(31)  评论(0编辑  收藏  举报