Write a Python program that performs the following task on a tuple:

ICSE Class 10 Robotics & AI PYQ · 2026 Improvement · Section B

7(iii)Written · 2026 · Section B · 2026 Improvement

Write a Python program that performs the following task on a tuple:

  1. Create a tuple 't1' with elements (100, 110, 120, 330, 440)
  2. Concatenate a tuple 't2' with elements (77, 88) to 't1'
  3. Convert the above tuple to list.
  4. Append another list 'lst2' with elements [16, 26]
  5. Remove element in the second index.
  6. Insert element 40 to the list at index 5.
  7. Print the list.
Show SolutionHide Solution↓
t1 = (100, 110, 120, 330, 440)

t2 = (77, 88)
t1 = t1 + t2

lst1 = list(t1)

lst2 = [16, 26]
lst1.append(lst2)

lst1.pop(2)

lst1.insert(5, 40)

print("List after operations:")
print(lst1)
List after operations:
[100, 110, 330, 440, 77, 40, 88, [16, 26]]

← Previous questionNext question →

Browse the free Robotics & AI sample bank