Straight A's

Report a typo

Write a program that calculates the proportion of students who received grade A.

A five-point rating system with grades A, B, C, D, F is used.

Input format:
A string with students' marks separated by space. At least one mark will be present.

Output format:
A fractional number with exactly two decimal places.

To format the decimal places use the round(number, places) function.

Calculate the ratio of all A's to the total number of the given grades: save the grades in a list, count A's and divide the result by the length of the list.

Sample Input 1:

F B A A B C A D

Sample Output 1:

0.38

Sample Input 2:

B C B

Sample Output 2:

0.0

Sample Input 3:

A D

Sample Output 3:

0.5
Write a program in Python 3
# put your python code here
___

Create a free account to access the full topic