11. What method is used to convert a string to uppercase in Python?
12. Which method is used to replace a substring in a string with another substring?
13. In Python, how can you check if a string starts with a specific substring?
14. Which method is used to count the occurrences of a substring in a string?
15. What is the purpose of the strip() method for strings?
16. What is the output of the following code:
string = "Python"
print(string[::-1])
string = "Python"
print(string[::-1])
17. What will the following code output:
string = "Python"
print(string.lower())
string = "Python"
print(string.lower())
18. In Python, which escape sequence is used to represent a tab character?
19. What does the isalpha() method of a string object check for?
20. What is the output of the following code:
string = "Python"
print(string[1:])
string = "Python"
print(string[1:])
Read More Section(Strings in Python)
Each Section contains maximum 100 MCQs question on Strings in Python. To get more questions visit other sections.