Write a Python program that performs the following operations on a string:

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

6(iii)Written · 2026 · Section B · 2026 Improvement · 🔁 also 2025

Write a Python program that performs the following operations on a string:

Show SolutionHide Solution↓
s = "Computer Applications"

length = len(s)
print("Length of the string:", length)

count_p = "Applications".count('p')
print("Occurrences of 'p' in 'Applications':", count_p)

pos = s.find("Applications")
print("Position of 'Applications':", pos)

upper_check = s.isupper()
print("Is the string in uppercase:", upper_check)

new_s = s.replace("Applications", "Science")
print("New string:", new_s)
Length of the string: 21
Occurrences of 'p' in 'Applications': 2
Position of 'Applications': 9
Is the string in uppercase: False
New string: Computer Science

← Previous questionNext question →

Browse the free Robotics & AI sample bank