Write a Python program to:

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

6(iii)Written · 2026 · Section B · 2026 Paper

Write a Python program to:

Show SolutionHide Solution↓
lst = [12, 45, 7, 23, 89, 34, 56, 90, 11, 5]

second_index = lst[2]
fourth_index = lst[4]

print("Element at 2nd index:", second_index)

print("Element at 4th index:", fourth_index)

lst.sort()

print("Sorted list:")
print(lst)

num = int(input("Enter a number to search: "))

if num in lst:
    print("Number exists in the list")
else:
    print("Number does not exist in the list")
Element at 2nd index: 7
Element at 4th index: 89
Sorted list:
[5, 7, 11, 12, 23, 34, 45, 56, 89, 90]
Enter a number to search: 23
Number exists in the list
← Previous questionNext question →

Browse the free Robotics & AI sample bank