I need to write a program in Python that counts the number of "holes" in a string. Imagine, for example, that the letters "A", "D", "O", "P", "R" have only one hole. Likewise, the letter "B" has two holes. The letters "C", "E", "F", "K" have no holes. The program should consider that the number of holes in a text is equal to the total number of holes in the letters of the text. The user must supply two information in the input, in two lines: The first line contains a simple integer T < = 40 that indicates the number of test cases. Then, there are T test cases. Each line of the test case contains non-empty text composed only of uppercase English alphabet characters. The size of each text is less than 100. There are no spaces in the input. For each test case, the output consists of a line containing the number of holes found in the test case. If the entries are:
3
LARANJA
UVA
PERA
The output would be:
4
1
3
I have not tried any promising code yet. I need a tip.