陳以鈞w3schools字串str串列list集合set字典dict元組tuple
A="以下有關聯合國永續發展目標(Sustainable Development Goals, SDGs)之敘述,請問何者有誤?(1)SDGs 4是「確保有教無類、公平以及高品質的教育,及提倡終身學習」(Quality Education),包含消除教育上的性別差距不能雙重標準公然性羞辱(2)SDGs 5是「實現性別平等,並賦予婦女權力」(Gender Equality),包含終結所有對婦女和女童的各種形式歧視(3)SDGs 8是「促進包容且永續的經濟成長,讓每個人都有一份好工作」(Decent Work and Economic Growth),包含保護勞工的權益,為所有勞工創造安全有保障的工作環境(4)SDGs 16是「促進和平多元的社會,確保司法平等,建立具公信力且廣納民意的體系」(Peace, Justice and Strong Institutions),包含促進及落實沒有歧視的法律與政策,以實現永續發展"
print(A)#A字串stringlist串列,set集合,dict字典
print('長度',len(A))
print('型態type',type(A))
B=list(A)#將他轉為list串列
print(B)
print(type(B))
C=set(A)
print(type(C),C) #從字串string轉到集合
D=set(B)
print(type(D),D) #從串列list轉到集合
print('是否相等',C==D) #以下統計每個字元出現的次數
E = dict() #定義字典變數E{鍵key:值value}
for i in C: E[i]=0 #所有的字典value都是0
for i in C:
for j in A:
1030.商業軟體。https://tyuiop715547.blogspot.com/2026/10/excelandorcountcountifindirect.html
回覆刪除1016.商業軟體。https://tyuiop715547.blogspot.com/2026/10/excelmatchindexisnumber.html
1019.input.https://tyuiop715547.blogspot.com/2026/10/pythoninputfind-1.html
1012.字典.https://tyuiop715547.blogspot.com/2026/10/pythonsetdict372411251.html
1005.必須使用pre才能清楚呈現。https://tyuiop715547.blogspot.com/2026/10/w3schoolsstrlistsetdicttuple.html