Which of the following is the correct way to define a string in Python?
What will be the output of the following code?
str = "Python"
print(str[1:4])
1 Crore+ students have signed up on EduRev. Have you? Download the App |
Which of the following methods is used to convert a string to uppercase in Python?
What is the result of the following expression?
"Python" + "Programming"
What will be the output of the following code?
str1 = "Hello"
str2 = "World"
print(str1 + str2)
What will be the output of the following code?
str = "Python Programming"
print(str[7])
What will be the output of the following code?
str = "Python"
print(str[-2:])
What will be the output of the following code?
str = "Hello World"
print(str.split())
What will be the output of the following code?
str = "Python Programming"
print(str.replace("Python", "Java"))
What will be the output of the following code?
python str = "Hello World" print(str[::-1])
What will be the output of the following code?
str = "Python Programming"
print(str.index("Prog"))
What will be the output of the following code?
str1 = "Hello"
str2 = "hello"
print(str1 == str2)
What will be the output of the following code?
str = "Python Programming"
print(str.count("P"))
49 videos|38 docs|18 tests
|
49 videos|38 docs|18 tests
|