Adaptive Practice
Strings in Python
10 questions • Earn up to 101 XP • First attempt — go for 100%!
0
XP
0
Correct
x1
Combo
Question 1 of 10
⏱ 0:30
Easy
Which of the following is the correct way to create a string in Python?
Easy
What will be the output of the following code?
print(len('India'))
Easy
Which of the following methods converts all characters of a string to uppercase?
Medium
What will be the output of the following code?
print('CBSE'[1:4])
Medium
Which of the following is NOT a valid way to concatenate two strings s1 and s2 in Python?
Medium
What will be the output of the following code?
s = 'Python'
print(s[-3])
Medium
Which method would you use to check if a string s contains only digits?
Hard
What is the result of the expression:
'Hello'.replace('l', 'L', 1)
Medium
Consider the string s = 'India is my country'. What will s.split(' ')[2] return?
Easy
What will be the output of the following code?
print('abc' * 3)