Problemas
You are writing code to return a letter grade based on the following criteria - The variable grade stores the numeric grade as a whole number botwoen 0 and 100 - Grades from 00 to 100=A - Grades from 60 to 09 - 1) - Grados from 70 to 70=C - All other grades are failing Complete the code try selecting the correct cole segment from each drop. down list Noto You will recerve partial credit for each correct selection ..... Answer Area square Brade to 100 square print Your grade is A. - square grade is 801 print Your grade is B. - square - grade 480 square print "Your grade is C. square print "Your grade is failing:" square print "Invalid grade entered,"
Solución
Marcoélite · Tutor durante 8 años
Verificación de expertos
4.3 (159 votos)
Responder
Here is the completed code based on the provided criteria:<br /><br />```python<br />grade = 85 # Example grade<br /><br />if grade >= 80:<br /> print("Your grade is A.")<br />elif grade >= 70:<br /> print("Your grade is B.")<br />elif grade >= 60:<br /> print("Your grade is C.")<br />else:<br /> print("Your grade is failing.")<br />```<br /><br />Explanation:<br />- The `if` statement checks if the grade is 80 or above, which corresponds to an A.<br />- The `elif` statement checks if the grade is between 70 and 79, which corresponds to a B.<br />- The next `elif` statement checks if the grade is between 60 and 69, which corresponds to a C.<br />- If none of the above conditions are met, the grade is considered failing, and the corresponding message is printed.
Haz clic para calificar: