Completed
Class 11 CS – Python Fundamentals & Control Flow Test
Questions From This Challenge
Q1output1 mark
What will be the output of the following Python code?
a = 7 b = 3 print(a + b * 2) print((a + b) * 2)
Correct output:
13
20Q2mcq1 mark
Which of the following statements correctly describes an immutable data type?
Its contents can always be changed after creation
Its value cannot be changed after creation ✓
It can store only numeric values
It can contain only one element
Q3output1 mark
What will be the output of the following Python code?
x = 17 y = 5 print(x // y) print(x % y)
Correct output:
3
2Q4output1 mark
What will be the output of the following Python code?
s = "COMPUTER" print(s[2]) print(s[-2])
Correct output:
M
EQ5output1 mark
What will be the output of the following Python code?
s = "PYTHON" print(s[1:5]) print(s[:3])
Correct output:
YTHO
PYTQ6output1 mark
What will be the output of the following Python code?
a = "Good" b = "Luck" print(a + " " + b) print(a * 2)
Correct output:
Good Luck
GoodGoodQ7mcq1 mark
Which of the following correctly converts the string "25" into an integer and then adds 5?
"25" + 5
int("25") + 5 ✓
float("25") + "5"
str("25") + 5
Q8output1 mark
What will be the output of the following Python code?
x = 12
if x > 10:
print("A")
if x > 15:
print("B")
else:
print("C")
Correct output:
A
CQ9output1 mark
What will be the output of the following Python code?
n = 21
if n % 2 == 0:
print("Even")
elif n % 3 == 0:
print("Divisible by 3")
else:
print("Other")
Correct output:
Divisible by 3Q10output1 mark
What will be the output of the following Python code?
total = 0
for i in range(1, 6):
total += i
print(total)
Correct output:
15Q11output1 mark
What will be the output of the following Python code?
x = 2
while x < 20:
x = x * 2
print(x)
Correct output:
32Q12mcq1 mark
Which of the following is a valid Python statement?
2value = 10
class = 20
student_name = "Ravi" ✓
student-name = "Ravi"
Q13output1 mark
What will be the output of the following Python code?
x = 8 y = 3 print(x > 5 and y < 5) print(x < 5 or y == 3)
Correct output:
True
TrueQ14output1 mark
What will be the output of the following Python code?
s = "DATABASE" print(s[0:4] + s[4:])
Correct output:
DATABASEQ15mcq1 mark
A Python program accepts a number using input() and then tries to perform arithmetic directly on that input without converting its data type. Which issue is most likely to occur?
The input is automatically converted to an integer
The input is automatically converted to a float
Arithmetic may fail because input() returns a string ✓
The program always produces a syntax error