Beginner her. Could someone interpret this sentence. Thank you
02:10 21 Jul 2021

Suppose you are given a string and you want to count how many times each letter appears. There are several ways you could do it:

  1. You could create 26 variables, one for each letter of the alphabet. Then you could traverse the string and, for each character, increment the corresponding counter, probably using a chained conditional.

  2. You could create a list with 26 elements. Then you could convert each character to a number (using the built-in function ord), use the number as an index into the list, and increment the appropriate counter.

for the 2nd part I don't understand what using the ord function has to do with indexing to the list. since ord return the unicode of the character not an index.

python list loops