Write a Python program that performs the following tasks:

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

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

Write a Python program that performs the following tasks:

Show SolutionHide Solution↓
tup = (100, 200, 700, 300, 150)

lst = list(tup)

idx = lst.index(700)
lst.remove(700)
lst.insert(idx, 650)

lst.sort()

final_tup = tuple(lst)

print("Final tuple:")
print(final_tup)
Final tuple:
(100, 150, 200, 300, 650)

← Previous questionNext question →

Browse the free Robotics & AI sample bank