python占位符詳解 python如何在一個字符串中使用兩個占位符?
python如何在一個字符串中使用兩個占位符?1. 使用連接器:12world=“world”print“Hello”world“! 2. 使用占位符插入world=“world”print“您好%s
python如何在一個字符串中使用兩個占位符?
1. 使用連接器:
12
world=“world”print“Hello”world“
! 2. 使用占位符插入
world=“world”print“您好%s!%世界
3。使用函數(shù)
Li=[“my”,“name”,“is”,“Bob”]mystr=。Join(LI)print mystr
以上語句中的字符串作為參數(shù)傳入,并可以直接替換為變量:
begin “date=”2012-04-06 00:00”end “date=”2012-04-06 23:59:59”select*from usb where time between to “date(begin ”date,“YYYY-MM-DD HH24:MI:SS”)and to “date(end ”date,“YYYY-MM-DD)”HH24:MI:SS“”)