#Python TQC考題706 全字母句
k=eval(input())
for i in range(k):
s=input()
chars=set(s.lower())
#set沒有重複值
chars.remove(” “)
print(len(chars)==26)

#做第二次:

#str1.replace(” “,””) 把空白取代為什麼都沒有
#不能用.strip(),只會去除左右兩邊的空白
#中間的空白無法用.strip()去除
#重點是記得用set()做

“””
這次做複雜了
set(str)就可以將字串拆分為各字母
不用透過list()中介
“””

“””
做回原本簡單的作法
list使用.remove(” “) 移除空白
str使用.replace(” “,”” )
將空白取代為什麼都沒有
且要用strNew承接replace後的字串
“””

“””
雖然簡單,還是會小漏
例如:忘記使用strNew
承接.replace()後的字串
最後一行的len()也會遺漏
“””





![Python 表達式中的魔法:用海象運算子讓斷詞程式碼更乾淨 [w_clean for w in words if (w_clean:=w.lower().strip()) and w_clean not in STOPWORDS] Python 表達式中的魔法:用海象運算子讓斷詞程式碼更乾淨 [w_clean for w in words if (w_clean:=w.lower().strip()) and w_clean not in STOPWORDS]](https://i1.wp.com/savingking.com.tw/wp-content/uploads/2026/02/20260210083748_0_a7d9bf.png?quality=90&zoom=2&ssl=1&resize=350%2C233)



![Python: 如何將folder_name, file_name合併為file_path? fpath = os.path .join(folder, fname) ; “\\”.join([folder, fname]) ; 如何將file_path拆分出folder? Python: 如何將folder_name, file_name合併為file_path? fpath = os.path .join(folder, fname) ; “\\”.join([folder, fname]) ; 如何將file_path拆分出folder?](https://i0.wp.com/savingking.com.tw/wp-content/uploads/2023/03/20230330132954_84.png?quality=90&zoom=2&ssl=1&resize=350%2C233)


近期留言