Respuesta :

Answer:

The complete code in Python language along with comments for explanation and output results are provided below.

Code with Explanation:

# the index variable will store the number of times "A" is entered

index = 0

while True:

# get the input from the user

   letter = input('Please enter letter grades: ')

# if the user enters "enter" then break the loop

   if letter == "":

       break

# if user enters "A" then add it to the index

   if letter == "A":

       index = index + 1

# print the index variable when the loop is terminated

# the str command converts the numeric type into a string

print("Number of times A is entered: " + str(index))

Output:

Please enter letter grades: R

Please enter letter grades: A

Please enter letter grades: B

Please enter letter grades: L

Please enter letter grades: A

Please enter letter grades: A

Please enter letter grades: E

Please enter letter grades:

Number of times A is entered: 3

Ver imagen nafeesahmed