Chapter 8 · Class 11 · CBSE · Science Computer Science
Strings
25 practice questions · 5 marks weightage
Topics in this chapter
- String Indexing and Slicing
- String Methods and Manipulation
- String Searching and Validation
- String Immutability and Operators
- String Coding Problems and Palindromes
Cheat sheet
Cheat SheetPractice questions
- Question 1Q-AE296DSee the answer and solution
What is printed by the following Python code? s = "banana"; print(s[1:6:2])
- A.ban
- B.aaa
- C.nna
- D.ana
- Question 2Q-1AA662See the answer and solution
What is the output of the following Python code? s = "Mississippi"; print(s.count("s"), s.find("sip"))
- A.4 5
- B.4 4
- C.3 5
- D.3 4
- Question 3Q-E3C877See the answer and solution
Explain string immutability in Python and show how to change the first character of the string "cat" to produce "bat".
- Question 4Q-2A6C7ESee the answer and solution
What is printed by the following Python code? word = "Python"; print(word[-2])
- A.t
- B.h
- C.o
- D.n
- Question 5Q-C714C8See the answer and solution
What is printed by the following Python code? s = " Data Science "; print(s.strip().replace(" ", "_").lower())
- A.Data_Science
- B.data_science
- C.data_science
- D.data science
20 more questions on Strings
Sign up free to practise the full chapter. Questions you get wrong come back until you've mastered them.
Start practising freeFree to start · No credit card needed