nerdexam
Python_Institute

PCEP-30-02 · Question #27

What is the expected output of the following code? ``python 1 data = ['abc', 'def', 'abcde', 'efg'] 2 print(max(data)) ``

The correct answer is A. efg. See the full explanation below for the reasoning.

Question

What is the expected output of the following code?
1 data = ['abc', 'def', 'abcde', 'efg']
2 print(max(data))

Options

  • Aefg
  • Babc
  • Cdef
  • DThe code is erroneous.
  • Eabcde
  • FNone of the above.

How the community answered

(37 responses)
  • A
    78% (29)
  • B
    5% (2)
  • C
    3% (1)
  • D
    11% (4)
  • F
    3% (1)

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice