Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
417 views
in Technique[技术] by (71.8m points)

python - 计算字典中特定值的平均值? [关闭](Calculate averages of specific values in dictionaries? [closed])

For example, I have a dictionary with keys separated by vowels and consonants.

(例如,我有一本字典,其键由元音和辅音分开。)

dict = {'a':50, 'b':200, 'c':70, 'd':500, 'e':100}

How can I print out the average of the value of the vowels ('a' and 'e') and the average of the value of the consonants ('b', 'c', and 'd') as separate?

(如何分别打印出元音的平均值(“ a”和“ e”)和辅音的平均值(“ b”,“ c”和“ d”)?)

  ask by RRR translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...