Completed
Class 11 CS – Strings Live Challenge
Questions From This Challenge
Q1output1 mark
What will be the output of the following Python code?
s = "Computer" print(s[1:6])
Correct output:
omputQ2output1 mark
What will be the output of the following Python code?
s = "Python" print(s[-1]) print(s[-4:-1])
Correct output:
n
thoQ3output1 mark
What will be the output of the following Python code?
s = "Hi"
print(s * 3)
print("H" in s)
Correct output:
HiHiHi
TrueQ4output1 mark
What will be the output of the following Python code?
s = "COMPUTER"
for ch in s:
if ch in "AEIOU":
print(ch, end=" ")
Correct output:
O U EQ5mcq1 mark
Which expression produces the string "HELLO WORLD"?
"hello world".lower()
"hello world".upper() ✓
"hello world".capitalize()
"hello world".title()
Q6output1 mark
What will be the output of the following Python code?
s = "python programming" print(s.capitalize()) print(s.title())
Correct output:
Python programming
Python ProgrammingQ7output1 mark
What will be the output of the following Python code?
s = "banana"
print(s.count("a"))
print(s.find("na"))
Correct output:
3
2Q8mcq1 mark
Which statement about find() and index() is correct?
Both return the number of occurrences of a substring
Both return the position of the first occurrence, but index() raises an error if the substring is not found ✓
find() raises an error when the substring is not found, but index() returns -1
Both always return -1 when the substring is not found
Q9output1 mark
What will be the output of the following Python code?
s = "Report2026" print(s.isalnum()) print(s.isalpha()) print(s.isdigit())
Correct output:
True
False
FalseQ10output1 mark
What will be the output of the following Python code?
s = "Hello"
print(s.startswith("He"))
print(s.endswith("lo"))
print(s.islower())
print(s.isupper())
Correct output:
True
True
False
FalseQ11output1 mark
What will be the output of the following Python code?
s = " Python " print(s.strip()) print(s.lstrip()) print(s.rstrip())
Correct output:
Python
Python
PythonQ12output1 mark
What will be the output of the following Python code?
s = "I like Java"
print(s.replace("Java", "Python"))
Correct output:
I like PythonQ13output1 mark
What will be the output of the following Python code?
words = ["Python", "is", "easy"]
print(" ".join(words))
Correct output:
Python is easyQ14output1 mark
What will be the output of the following Python code?
s = "one,two,three"
parts = s.split(",")
print(parts)
print(len(parts))
Correct output:
['one', 'two', 'three']
3Q15output1 mark
What will be the output of the following Python code?
s = "Name:Rahul"
a, b, c = s.partition(":")
print(a)
print(b)
print(c)
Correct output:
Name
:
Rahul