Which of the following statements about strings in Python is correct?
What is the output of the following code snippet?
name = "John"
print(name[1:3])
1 Crore+ students have signed up on EduRev. Have you? Download the App |
Which method is used to determine the length of a string in Python?
Which of the following methods is used to remove leading and trailing whitespaces from a string in Python?
What is the output of the following code snippet?
text = "Hello, World!"
print(text.upper())
What is the output of the following code snippet?
message = "Welcome to Python"
print(message.split())
What is the output of the following code snippet?
text = "Hello, World!"
print(text.replace("o", "i"))
What is the output of the following code snippet?
text = "Python is fun"
print(text.startswith("Java"))
What is the output of the following code snippet?
text = "Python is fun"
print(text.find("is"))
Which of the following methods can be used to convert a string into a list in Python?
What is the output of the following code snippet?
text = "Hello,World"
print(text.split(","))
What is the output of the following code snippet?
text = "Hello, World!"
print(text[::-1])
What is the output of the following code snippet?
text = "Hello, World!"
print(text.count("o"))
What is the output of the following code snippet?
text = "Python is fun"
print(text[7:])