Completed

Revision: Fundamentals + Errors

Class 11 · Computer Science Fri, 9 Oct 2026 8:00 PM 60s / question 15 questions · 15 marks

Questions From This Challenge

Q1mcq1 mark
A student writes print('Hello and forgets to close the quotation mark, causing Python to report a problem before the program even begins running. This is an example of a:
Syntax error ✓
Logical error
Runtime error
Semantic feature
Q2mcq1 mark
A program intended to calculate the average of three numbers is written as average = a + b + c / 3 instead of average = (a + b + c) / 3. The program runs without crashing but produces the wrong result because operator precedence was not accounted for. This is an example of a:
Syntax error
Logical error ✓
Runtime error
Indentation error
Q3mcq1 mark
A program runs successfully until it executes the statement result = 10 / 0, at which point Python stops execution and reports an error. This is an example of a:
Syntax error
Logical error
Runtime error ✓
Compile-time warning
Q4mcq1 mark
What is the key difference between a syntax error and a runtime error in Python?
A syntax error is detected before execution begins; a runtime error occurs while the program is executing ✓
A syntax error only occurs in script mode; a runtime error only occurs in interactive mode
A syntax error always produces correct output; a runtime error never does
There is no difference; both terms mean the same thing
Q5mcq1 mark
Which of the following statements about Python dictionaries is correct?
A dictionary stores values that are accessed using an integer index starting from 0
A dictionary is a mapping type that stores data as key-value pairs and is mutable ✓
A dictionary cannot store more than one value in total
A dictionary is immutable, like a tuple
Q6mcq1 mark
What does the augmented assignment operator //= do in the statement total //= 3?
It performs floor division of total by 3 and assigns the result back to total ✓
It raises total to the power of 3
It checks whether total is divisible by 3
It is invalid syntax in Python
Q7mcq1 mark
A student wants to take a number as input from the user and immediately use it in a mathematical calculation. Which is the correct approach?
num = input("Enter a number: ") and use num directly in arithmetic
num = int(input("Enter a number: ")) to convert the input string to an integer before using it ✓
num = print(input("Enter a number: "))
Numbers cannot be taken as input in Python
Q8mcq1 mark
Which type of error is generally the hardest to detect, because the program runs and produces output without crashing, but the output itself is incorrect?
Syntax error
Logical error ✓
Runtime error
Indentation error
Q9output1 mark
What is printed when this code runs?
a = 15
b = 4
print(a // b, a % b, a / b)
Correct output: 3 3 3.75
Q10output1 mark
What is printed when this code runs?
value = "100"
total = int(value) + 50
print(total)
Correct output: 150
Q11output1 mark
What is printed when this code runs?
x = 7
y = 12
print(x < y and y < 20, x > y or y == 12)
Correct output: True True
Q12output1 mark
What is printed when this code runs?
score = 50
score += 20
score -= 5
score *= 2
print(score)
Correct output: 130
Q13output1 mark
What is printed when this code runs?
a = 10
b = 10
c = 10.0
print(a == c, a is c, a == b)
Correct output: True False True
Q14output1 mark
What is printed when this code runs?
word = "python"
print('y' in word, 'z' in word, 'z' not in word)
Correct output: True False True
Q15output1 mark
What is printed when this code runs?
temp = 36
unit = "C"
print("Temperature: " + str(temp) + unit)
Correct output: Temperature: 36C
Next Live Challenge
Mixed: Tuples + Dictionary + Modules
Class 11 · Computer Science Fri, 23 Oct 2026, 8:00 PM
View Live Challenges →

← Back to Live Challenge History · Practice MCQs

CodeBuddy
Hi there! 👋 I'm CodeBuddy, your KV Coders assistant.

To help me give you the most accurate answers, please select your class and subject below, or just type your question!
Buddy is typing...