Topics-Strings: introduction, string operations (concatenation, repetition, membership and slicing), traversing a string using loops, built-in functions/methods–len(), capitalize(), title(), lower(), upper(), count(), find(), index(), endswith(), startswith(), isalnum(), isalpha(), isdigit(), islower(), isupper(), isspace(),lstrip(), rstrip(), strip(), replace(), join(), partition(), split()

1. What is a string in programming?

 
 
 
 

2. Which of the following is a string operation that combines two or more strings together?

 
 
 
 

3. Which of the following string operations repeats a string a certain number of times?

 
 
 
 

4. What does the membership operation do with strings?

 
 
 
 

5. How can you traverse a string in Python?

 
 
 
 

6. Which built-in function is used to determine the length of a string?

 
 
 
 

7. Which built-in function is used to capitalize the first character of a string?

 
 
 
 

8. Which built-in function is used to convert the first character of each word in a string to uppercase?

 
 
 
 

9. Which built-in function is used to convert a string to lowercase?

 
 
 
 

10. Which built-in function is used to count the occurrences of a substring in a string?

 
 
 
 

11. Which built-in function is used to find the index of the first occurrence of a substring in a string?

 
 
 
 

12. Which built-in function is used to check if a string ends with a specific substring?

 
 
 
 

13. Which built-in function is used to check if a string starts with a specific substring?

 
 
 
 

14. Which built-in function is used to check if a string contains alphanumeric characters only?

 
 
 
 

15. Which built-in function is used to remove whitespace from the left side of a string?

 
 
 
 

Copywrite © 2020-2024, CBSE Python,
All Rights Reserved