Computer Science

Which of the following statements will create a tuple:

  1. tp1=("a", "b")
  2. tp1[2]=("a", "b")
  3. tp1=(3)*3
  4. None of these

Python Tuples

7 Likes

Answer

tp1=("a", "b")

Reason — A tuple is created by placing all the items (elements) inside parentheses () , separated by commas.

Answered By

1 Like


Related Questions