nerdexam
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)
  • A
    9% (3)
  • B
    3% (1)
  • C
    82% (28)
  • E
    6% (2)

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice