Firstly you have not define the variable
value
. Secondly you cannot get the count of characters from an array that contains words. You need to create two unique lists as you read the text, one for complete words and one for characters. You also need a frequency list to count the words which appear most often. You can get the counts for question A by using the
len
built-in function. See
Built-in Functions — Python 3.10.2 documentation[
^].