Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of the given options best describes the truthfulness of the following statements?

i) A tuple is a sequence of immutable Python objects, in the given tuple course = "l", "m", "n", "o", has four elements.
ii) To explicitly remove an entire tuple, use the drop statement.

  • A.i-True, ii-True
  • B.i-False, ii-True
  • C.i-True, ii-False
  • D.i-False, ii-False

Answer: C

Statement i is true and statement ii is false. A tuple is a sequence of immutable Python objects, and the tuple course with "l", "m", "n" and "o" has four elements. To remove an entire tuple explicitly, Python uses the del statement, and there is no drop statement for this, so statement ii is false. So the third option is correct. Items can still be removed from a tuple only by building a new one, because a tuple cannot be changed after it is made.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.