In: Computer Science
Answer using Jupyter Python
#Prompt the user to enter a passing grade and store the value
from
#the input() into a variable.
#Refer to the variable in problem 2 to complete the
following:
#Use the if statement to evaluate the only the first element in
the
#grades list using index notation.
#If the grade is passing, display PASSED, otherwise display
FAILED.
"""Problem 1d"""
#Use the for statement to iterate on each element in the
#grades list (from problem 1a) and displays each value.
#Specifically, for each grade in the grades list, if the grade
is
#passing (referring to problem 1b), then display PASSED, otherwise
display FAILED.
"""Problem 2a"""
#Create a function that will evaluate if each grade in a list is
considered
#passing or failing. [hint: use the for statement and if...else
together]
#Store the total number of passing and failing grades in their own
respective variables.
#The function should return a dictionary with two key-value pairs
where the keys are
# the words PASSED and FAILED mapped to their total counts
variable.
"""Problem 2b"""
#Call the function and pass in the grades list (from problem 1a) as
an argument.
Here is the solution to your
question. I tried my best to solve your doubt, however, if you find
it is not as good as expected by you. Please do write your further
doubts regarding this question in the comment section, I will try
to resolve your doubts regarding the submitted solution as soon as
possible.
Please give proper indentation as shown in the screenshot
If you think, the solution provided by me is helpful to you please
do an upvote.
Either you forget to upload some files or you have incomplete question. You have not provided any information regarding problem 2. However below is the solution based on your provided information that might help you:
|