Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions