Python TQC考題804 大寫轉換 .title() .upper() .lower() by 儲蓄保險王 · 2022-05-02 #Python TQC考題804 大寫轉換 s=input() print(s.upper()) print(s.title()) #三種都做 相關文章Python: 淺拷貝(Shallow Copy)和深拷貝(Deep Copy); list切片有淺拷貝的效果 ; pandas.Series.copy(deep=True) 可對Series對向執行深拷貝Python TQC考題208_十進位換算, if 條件1:動作1 elif 條件2:動作2,==為邏輯判斷式,=為指定Excel Vlookup函數第四個關鍵參數該用TRUE(1)還是FALSE(0)?你知道為何老是搜尋錯誤嗎?Python 讀取 DOCX 圖片關聯:qn+find/findall 與 XPath 的實戰對照 from lxml import etree ; from docx.oxml.ns import qn; lxml.etree._Element.findall( f".//{ qn('a:blip') }" ) ; .get( qn("r:embed") ) #獲取 屬性名 'r:embed' 的 屬性值(如: 'rId4') ; lxml.etree._Element.xpath( "//a:blip/@r:embed", namespaces = NS) #/@r:embed = 獲取 屬性名 'r:embed' 的 屬性值(如: 'rId4'),使用.findall() 要先.findall()獲取List[_Element],再迴圈_Element.get()獲取屬性值, .xpath() 第一個參數path 使用"//a:blip/@r:embed" ,可直接獲取屬性值(List[str]如: ['rId4', 'rId5']) ; 如何對docx真實移除圖片瘦身?Python TQC考題706 全字母句,set()元素不會重複,strNew=str1.replace(" ","")Python: enumerate 遍歷 ; lst1 = list( enumerate (seasons, start=1) ) ; for idx, sea in enumerate (seasons, start=1): print(idx,sea)Python: 字典方法 .pop() 與 .get() 的使用指南; dict.pop() 支援第二個參數#key不存在的話,返回第二個參數, list.pop() 不支援第二個參數Python: pandas.DataFrame 如何對某些欄做格式化字串? apply(); applymap() ; map() 的差別? df['Salary'] = df['Salary'].map( '${:,.2f}' .format)Python: pandas.DataFrame() 在不同資料類型(array/dict)下的 columns 參數用法 #賦值 #選擇
0 Python 進階:解剖 Word 底層 – 手動封裝 CT_P 與 CT_Tbl 全攻略; from docx.text.paragraph import Paragraph ; from docx.table import Table; para = Paragraph(child, doc) ; table = Table(child, doc) 2025-12-22
近期留言