Python_Institute
PCEP-30-02 · Question #319
What is the expected output of the following code? marks = [80, 70, 90, 90, 80, 100] average = sum(marks) // len(marks) grade = '' if 90 <= average <= 100: grade = 'A' elif 80 <= average < 90: grade…
The correct answer is C. C. See the full explanation below for the reasoning.
Question
What is the expected output of the following code?
marks = [80, 70, 90, 90, 80, 100]
average = sum(marks) // len(marks)
grade = ''
if 90 <= average <= 100:
grade = 'A'
elif 80 <= average < 90:
grade = 'B'
elif 70 <= average < 80:
grade = 'C'
elif 65 <= average < 70:
grade = 'D'
else:
grade = 'F'
print(grade)
Options
- AA
- BB
- CC
- DD
- EB
- FF
How the community answered
(34 responses)- A9% (3)
- B3% (1)
- C82% (28)
- E6% (2)
Community Discussion
No community discussion yet for this question.