2024/09/15 整理完成
學習 Python 字串格式化的方式
https://myapollo.com.tw/blog/python-f-string-formating-syntax/
https://steam.oxxostudio.tw/category/python/basic/format.html
https://docs.python.org/3/tutorial/introduction.html#text
https://docs.python.org/3/library/string.html#formatstrings
最詳盡舉例+樣板字串+巢狀置換 一些很特別的用法
https://dev.to/codemee/python-de-ge-shi-hua-zi-chuan-gong-neng-4o8
%(資料型態)格式
flag 前置符號
0 代表 補零
%03d
整數部分的最小寬度 (未滿維持)
小數部分的最大精度
常用的
%b 二進位 binary
%d 十進位整數 decimal
%f 浮點數 float
%s 字串
%d 十進制整數
%x 十六進制整數
*備註:與.format
不同
內建函式,format(參數,"格式化設定")
範例:
"字串" + "字串" 會自動合併
https://docs.python.org/3/library/string.html#grammar-token-format-string-format_spec
https://docs.python.org/zh-tw/3/library/datetime.html#strftime-and-strptime-behavior