Untitled
10 Questions
8 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

which method returns the index of a element in a tuple?

  • index() (correct)
  • count()
  • in()
  • out()
  • a string or list can be converted to a tuple using ______

  • list()
  • tuple() (correct)
  • string()
  • for()
  • find the output of x t=(1,3,7,4,2) x=t[2:-1] print(x)

  • (1,3)
  • (3,7)
  • (7,4) (correct)
  • (4,2)
  • what is the output of the following code: t=(5,3,3,4,5) x=t[2:-1] print(x)

    <p>(3,4)</p> Signup and view all the answers

    what is the output of the following code? z=("asha","hena","rose") print(z[-1:0])

    <p>()</p> Signup and view all the answers

    which of the following is a python tuple?

    <p>&lt;5,6,7&gt;</p> Signup and view all the answers

    the following code will not result in an error mytuple=(1,2,3,4) mytuple.append((5,6,7)) print(len(mytuple))

    <p>False</p> Signup and view all the answers

    what will be the output of the following code? z=('a','b','c','d','Dib') print(max(z))

    <p>d</p> Signup and view all the answers

    what is the output of the following code? z=([1,30],"xyz",2,7) z[0][1]=1 print(z)

    <p>([1,1],'xyz',2,7)</p> Signup and view all the answers

    what is the output of the following code? t1=(1,2,4,3) t2=(1,2,3,4) print(t1

    <p>False</p> Signup and view all the answers

    More Like This

    Python List Comprehension and Tuple Unpacking
    17 questions
    Python List, Tuple, and Set Operations
    24 questions
    Tuple Slicing Quiz
    5 questions

    Tuple Slicing Quiz

    ModestClematis2479 avatar
    ModestClematis2479
    Use Quizgecko on...
    Browser
    Browser