Home/Class 10/Chapter 4
Chapter 4 of 8

Control Structures in Python

Decision-making statements, while and for loops, Python lists, useful Python libraries, and techniques for testing and debugging code.

if / if-else / NestedWhile & For LoopsPython ListsPython LibrariesTesting & DebuggingPrograms

Multiple Choice Questions

10 MCQs — select an option to see if you got it right

1What is the role of the range() function in Python?

2What does this code output: count=0; for i in range(2): for j in range(3): count+=1; print(count)?

3Which method adds an item to the end of a list in Python?

4What do control structures accomplish in programming?

5Which statement runs code when a condition turns out false?

6How can you stop print() from adding a newline?

7Which library generates random numbers?

8What does list.append() do?

9The type of testing that verifies how different parts of the code work together is called:

10Which debugging technique relies on adding output statements?

Short Questions with Answers

11 short-answer questions

Long Questions with Answers

10 in-depth answers

Important Questions

4 high-priority questions for revision