slowo = "aaaaaaaaabbzz"zliczacz = [0] * 26for litera in slowo: zliczacz[ord(litera) - ord("a")] += 1 print(zliczacz)
Standard input is empty
[9, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!