CBSE · 083Class XII · 2024Section A1 mark

Question 08

2 April 2024 · Computer Science (083)

Consider the statements given below and then choose the correct output from the given options :

python
myStr = "MISSISSIPPI"
print(myStr[:4]+"#"+myStr[-5:])

Answer

(b) MISS#SIPPI

Explanation

myStr[:4] gives 'MISS' and myStr[-5:] gives 'SIPPI'. Concatenating them with '#' gives 'MISS#SIPPI'.