Q:

What is the output? Y=[2,5J,6] Y.sort()

-15

What is the output?

Y=[2,5J,6] Y.sort()

  1. [2,6,5J]
  2. [5J,2,6]
  3. Error
  4. [6,5J,2]

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Correct Answer:

C.Error

 

Explanation:

sort() function can sort numbers only, and in Y list notice that the 2nd element is not a number, so this will cause a compile error.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Python Multiple Choice Questions And Answers

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
In which of the following we can use "in"... >>
<< Output of 7^10 is...