char1 = ” “
for i in range(5) :
#從0開始,間距1,持續5次=> 0 1 2 3 4
#只輸入一個參數,預設從0開始,間距1
char1 = char1 + str(i) + ” “
print(char1)
#####
char2 = ” “
for j in range(0,4) :
#從0開始,間距1,持續4次=>0 1 2 3
#從0開始,間距1,到4為止,4不算=> 0 1 2 3
char2 = char2 + str(j) + ” “
print(char2)
#####
char3 = ” “
for k in range(1,4) :
#從1開始,間距1,持續3次=>1 2 3
#從1開始,間距1,到4為止,4不算
char3 = char3 + str(k) + ” “
print(char3)
#####
char4 = ” “
for l in range(0,10,2) :
#從0開始,到10結束,10不算,間距2=>0 2 4 6 8
char4 = char4 + str(l) + ” “
print(char4)
#####
char5 = ” “
for m in range(1,10,2) :
#從0開始,到10結束,間距2=>1 3 5 7 9
char5 = char5 + str(m) + ” “
print(char5)
Spyder執行結果:


![Python爬蟲:BeautifulSoup的 .find_all() 與 .find() 與 .select(‘標籤名[屬性名1=”屬性值1″][屬性名2=”屬性值2″]’) ; from bs4 import BeautifulSoup ; Live Server(可以預覽HTML的VS Code套件) Python爬蟲:BeautifulSoup的 .find_all() 與 .find() 與 .select(‘標籤名[屬性名1=”屬性值1″][屬性名2=”屬性值2″]’) ; from bs4 import BeautifulSoup ; Live Server(可以預覽HTML的VS Code套件)](https://i2.wp.com/savingking.com.tw/wp-content/uploads/2025/03/20250330190318_0_925655.jpg?quality=90&zoom=2&ssl=1&resize=350%2C233)

![Python: pandas.Series如何只保留str,去除重複值?#isinstance(x:Any, str) -> bool #.drop_duplicates() #Series.apply( function )逐元素應用function運算 #DataFrame.apply( function )逐Series應用function運算 .drop_duplicates() 跟.unique()有何差別? df.drop_duplicates() 等效於 df[~df.duplicated()] Python: pandas.Series如何只保留str,去除重複值?#isinstance(x:Any, str) -> bool #.drop_duplicates() #Series.apply( function )逐元素應用function運算 #DataFrame.apply( function )逐Series應用function運算 .drop_duplicates() 跟.unique()有何差別? df.drop_duplicates() 等效於 df[~df.duplicated()]](https://i2.wp.com/savingking.com.tw/wp-content/uploads/2024/11/20241123194900_0_5218de.png?quality=90&zoom=2&ssl=1&resize=350%2C233)


![Python:如何使用 PyMuPDF (import fitz ) 提取 PDF 文本區塊並存儲為 DataFrame ; text: List[ Tuple[float|str|int] ] = page.get_text(“blocks”) Python:如何使用 PyMuPDF (import fitz ) 提取 PDF 文本區塊並存儲為 DataFrame ; text: List[ Tuple[float|str|int] ] = page.get_text(“blocks”)](https://i1.wp.com/savingking.com.tw/wp-content/uploads/2025/03/20250320084417_0_7783bd.png?quality=90&zoom=2&ssl=1&resize=350%2C233)



近期留言