第一階段考試題

1.設計一個函數,統計一個字符串中出現頻率最高的字符(單個符號)及其出現次數函數 #利用字典的key值惟一這個特色把字符串的每個字符做爲key,次數做爲value {字符:次數} def get_count(str1): count_dict={} for i in str1: count = count_dict.get(i,0) count += 1 coun
相關文章
相關標籤/搜索