Question: Write a python function enterAGrade that does the following: a). Assign to a local variable st the value returned by a call to input with

Write a python function enterAGrade that does the following:

a). Assign to a local variable st the value returned by a call to input with the following message: Please enter a grade in [0,100] .

b). Assign a local variable grade with the value of st casted as an integer, that is, int(st); print the value of the grade variable. Test your function (youll have to enter a value from the console).

We now want to print multiple grades entered by the user. Write a function enterSomeGrades() that does the following:

a). Initialize a local variable aList to an empty list.

b). Assign to a local variable st the value returned by a call to input with the following message: Please enter a grade in [0,100] .

c). Append to the list aList the value of st casted as an integer.

d). Assign to st the value returned by a call to input with the following message: continue y or n?.

e). While st is equal to y do:

-Assign to st the value returned by a call to input with the following message: Please enter a grade in [0,100] .

-Append to the list aList the value of st casted as an integer.

- Assign to st the value returned by a call to input with the following message: continue y or n?.

f). At the end, print aList.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!