Write a Python program that does the following using string built-in functions:

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

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

Write a Python program that does the following using string built-in functions:

stg = " Welcome to My Python Project "
Show SolutionHide Solution↓
stg = " Welcome to My Python Project "

stg = stg.lower()
print("Lowercase string:", stg)

stg = stg.replace("my", "your")
print("After replacement:", stg)

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

ends = stg.endswith('T')
print("Ends with 'T':", ends)

reversed_chars = stg[3:7][::-1]
print("Characters from index 3 to 6 in reverse order:", reversed_chars)
Lowercase string:  welcome to my python project 
After replacement:  welcome to your python project 
Length of the new string: 32
Ends with 'T': False
Characters from index 3 to 6 in reverse order: mocl

← Previous question

Browse the free Robotics & AI sample bank