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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started