1.

Consider the following tuples, tuple1 and tuple2:​tuple1 = (23,1,45,67,45,9,55,45)tuple2 = (100,200)Find the output of the following statements: print(tuple1.index(45)) print(tuple1.count(45)) print(tuple1 + tuple2) print(len(tuple2)) print(max(tuple1)) print(min(tuple1)) print(sum(tuple2)) print(sorted (tuple1)) print(tuple1)

Answer» Consider the following tuples, tuple1 and tuple2:



​tuple1 = (23,1,45,67,45,9,55,45)

tuple2 = (100,200)



Find the output of the following statements:

  1. print(tuple1.index(45))

  2. print(tuple1.count(45))

  3. print(tuple1 + tuple2)

  4. print(len(tuple2))

  5. print(max(tuple1))

  6. print(min(tuple1))

  7. print(sum(tuple2))

  8. print(sorted (tuple1))

    print(tuple1)



Discussion

No Comment Found

Related InterviewSolutions