Sequencing
Selection
Iteration
Procedures
Abstraction
100

What does sequencing mean in a program?

Order in which code instructions are executed.

100

What keyword starts a conditional statement in Python?

if

100

What does a loop do?

Repeats a set of instructions.

100

What is a function?

A named block of code that performs a task.

100

What is abstraction in computer science?

Simplifying complex systems by hiding details.

200

What is the output?


x = 5  

x = x + 2  

print(x)


7

200

What is the output? 

x = 10  

if x > 5:  

 print("Big")


Big

200

How many times does this loop run?

for i in range(3):  

 print(i)


3 times (prints 0, 1, 2)

200

What does this function return?

def double(x):  

 return x * 2  

print(double(3))


6

200

How does abstraction help in programming?

Makes it easier to understand and manage large programs.

300

What happens if you call a variable before it is assigned a value?

Causes a runtime error 

300

When is an else clause executed?

When all preceding if and elif conditions are false.

300

What’s the output?

count = 0  

while count < 3:  

 print(count)  

 count += 1



0, 1, 2

300

Why are functions useful?

They allow code to be reused and keep programs organized

300

Why do programmers create custom functions for repeated tasks?

To reduce code repetition and increase modularity.

400

Rearrange the steps below to correctly calculate the area of a rectangle:

Print area

Assign area = length * width

Input width

Input length

Input length → Input width → Assign area → Print area

400

What will this code print?

x = 8  

if x < 5:  

 print("Small")  

elif x < 10:  

 print("Medium")  

else:  

 print("Large")


Medium

400

Why might this loop run forever?

while True:  

 print("Hello")


Because True is always true and there's no break condition.

400

What is the output?

def greet(name):  

 return "Hello " + name  

print(greet(name))


Hello (name)

400

How would you use abstraction when designing a game?

Create separate functions for movement, scoring, display, etc., instead of writing everything in one place.

500

A student writes a program where an input comes after the output. What’s the likely problem?

The output might display incorrect or default values because the needed input wasn't available in time.

500

A student writes this code: 

score = 85  

if score >= 90:  

 grade = "A"  

if score >= 80:  

 grade = "B"  

print(grade)


Why does it output "B" and not "A"? 

Because both if statements are checked independently, not exclusively, no elif.

500

Predict the output:

for i in range(2):  

 for j in range(3):  

  print(i, j)


0 0  

0 1  

0 2  

1 0  

1 1  

1 2


500

Fix the error: 

def subtract(a, b):  

 result = a - b  

print(result)


return result and then call print(subtract(x, y))

500

A student wrote all code in one long sequence. How could abstraction improve this?

By breaking it into logical, reusable procedures that make the program more readable, testable, and maintainable.

M
e
n
u