#30783: python有個東西叫套件


a110608@ctes.ylc.edu.tw (鍾均)


1.使用collections的Counter

2.轉成set去除重複元素

3.用sorted,記得reverse要設為True

#30784: Re: python有個東西叫套件


a110608@ctes.ylc.edu.tw (鍾均)


1.使用collections的Counter

2.轉成set去除重複元素

3.用sorted,記得reverse要設為True


Counter如果加上most_common,就可以直接取index 0