我有這個清單:
['Fantasy', 'Young Adult', 'Paranormal', 'Paranormal Romance']
是否可以將這兩個詞加入到一個專案中,例如 'Young.Adult'
我的意思是一般來說,不是那兩個詞(串列只包含最多兩個詞)。
uj5u.com熱心網友回復:
那應該這樣做:
for word in ['Fantasy', 'Young Adult', 'Paranormal', 'Paranormal Romance']:
print(word.replace(" ", "."))
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/413369.html
標籤:
上一篇:比較兩個集合串列
