0
を書き込むことができます私はこの機能を書いた:は異なる方法で
def make_upper(words):
for word in words:
ind = words.index(word)
words[ind] = word.upper()
をしかし、私は精通していないですラムダ関数を使用して、それを記述する必要があります。何か案は?
私はまた、各文字の出現回数をカウント機能を書いた:
def letter_cnt(word,freq):
for let in word:
if let == 'A': freq[0]+=1
elif let == 'B': freq[1]+=1
elif let == 'C': freq[2]+=1
elif let == 'D': freq[3]+=1
elif let == 'E': freq[4]+=1
だから私は辞書を使用して、それを記述する必要があります。助言がありますか?