0% found this document useful (0 votes)
18 views

python_unit2_quiz_full_final_ready

The document contains a full quiz for an ITS Python Certification Unit on Control Flow with Decisions and Loops, consisting of 50 questions divided into single choice and multiple choice formats. It covers various topics such as keywords, loop types, logical operators, and comparison expressions. The quiz is designed to assess understanding of control flow concepts in Python programming.

Uploaded by

leo ling
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

python_unit2_quiz_full_final_ready

The document contains a full quiz for an ITS Python Certification Unit on Control Flow with Decisions and Loops, consisting of 50 questions divided into single choice and multiple choice formats. It covers various topics such as keywords, loop types, logical operators, and comparison expressions. The quiz is designed to assess understanding of control flow concepts in Python programming.

Uploaded by

leo ling
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

ITS Python Certification - Unit 2: Control Flow with Decisions and Loops -

Full Quiz (Complete 50 Questions)


(Student Version with Full Questions and Options)

Single Choice Questions (30 Questions)


1. Which keyword is used when the `if` condition is false?

• (A) elif
• (B) else
• (C) while
• (D) continue

2. What is the result of `5 > 3 and 2 < 1`?

• (A) True
• (B) False
• (C) Error
• (D) None

3. Which type of loop runs a known number of times?

• (A) while
• (B) for
• (C) if
• (D) elif

4. Which operator checks inequality?

• (A) ==
• (B) !=
• (C) >
• (D) <

5. Which keyword exits the current loop immediately?

• (A) continue
• (B) break
• (C) stop
• (D) exit

6. What does `continue` do in a loop?

Page ______
• (A) Ends the loop
• (B) Skips the current iteration
• (C) Repeats the current iteration
• (D) Breaks loop

7. Which loop continues while a condition is true?

• (A) for
• (B) while
• (C) if
• (D) break

8. What value is printed first: `for i in range(3): print(i)`?

• (A) 1
• (B) 2
• (C) 0
• (D) 3

9. Which keyword is for another condition?

• (A) elif
• (B) else
• (C) continue
• (D) break

10. How many iterations for `range(0, 6, 2)`?

• (A) 2
• (B) 3
• (C) 4
• (D) 6

11. How many iterations in nested loops `for i in range(3)` and `for j in range(3)`?

• (A) 3
• (B) 6
• (C) 9
• (D) 12

12. Which logical operator returns True if either condition is true?

• (A) and
• (B) or
• (C) not
• (D) break

Page ______
13. Result of `if not (3 > 5): print('Yes') else: print('No')`?

• (A) Yes
• (B) No
• (C) Error
• (D) None

14. Which loop guarantees at least one execution in other languages?

• (A) for
• (B) while
• (C) do-while
• (D) if

15. Function to generate sequence?

• (A) range()
• (B) list()
• (C) dict()
• (D) gen()

16. Result of `if 7 < 10`?

• (A) True
• (B) False
• (C) Error
• (D) None

17. Purpose of `elif`?

• (A) Stop loop


• (B) Add alternative condition
• (C) Skip block
• (D) Exit

18. Effect of `not` operator?

• (A) Negate a condition


• (B) Repeat loop
• (C) Break loop
• (D) None

19. How many times `while count < 3` runs if starting at 0?

• (A) 1
• (B) 2

Page ______
• (C) 3
• (D) Infinite

20. What does `range(1,5)` output?

• (A) 1 2 3
• (B) 1 2 3 4
• (C) 0 1 2 3
• (D) 1 2 3 4 5

21. Which block checks for exact equality?

• (A) >
• (B) ==
• (C) !=
• (D) and

22. Which operator means less than?

• (A) <
• (B) >
• (C) <=
• (D) or

23. Effect of `break` inside a loop?

• (A) Continues loop


• (B) Skips one iteration
• (C) Ends loop
• (D) None

24. Logical expression for `both must be true`?

• (A) and
• (B) or
• (C) not
• (D) elif

25. Which one is a loop control keyword?

• (A) elif
• (B) continue
• (C) if
• (D) print

26. Output of `for x in range(2,5)`?

Page ______
• (A) 2 3 4
• (B) 2 3 4 5
• (C) 3 4 5
• (D) 2 4

27. Which structure checks multiple exclusive conditions?

• (A) if-elif-else
• (B) for-loop
• (C) while-loop
• (D) range()

28. What does `while` loop require?

• (A) Condition
• (B) Counter
• (C) Boolean
• (D) Output

29. Which operator means greater than or equal to?

• (A) >=
• (B) <=
• (C) >
• (D) ==

30. What happens after `continue`?

• (A) Loop stops


• (B) Next iteration starts
• (C) Loop restarts
• (D) Break

Multiple Choice Questions (20 Questions)


31. Which are comparison operators?

• [ ] ==
• [ ] !=
• []>
• []<

32. Which are logical operators?

• [ ] and
• [ ] or
• [ ] not

Page ______
• [ ] if

33. Which are valid loop control keywords?

• [ ] break
• [ ] continue
• [ ] exit
• [ ] next

34. Which values does `range(5)` generate?

• []0
• []1
• []2
• []5

35. Conditions that will exit a `while` loop?

• [ ] False condition
• [ ] break
• [ ] continue
• [ ] infinite loop

36. Functions that generate sequences?

• [ ] range()
• [ ] list()
• [ ] dict()
• [ ] set()

37. Which are correct comparison expressions?

• []5>3
• [ ] 3 == 3
• [ ] 7 != 8
• [ ] 2 and 2

38. Which are loop types?

• [ ] for
• [ ] while
• [ ] if
• [ ] break

39. Which keywords are related to decision making?

• [ ] if

Page ______
• [ ] elif
• [ ] else
• [ ] break

40. Which keywords are part of iteration?

• [ ] for
• [ ] while
• [ ] range
• [ ] if

41. Which blocks need a condition?

• [ ] if
• [ ] while
• [ ] for
• [ ] print

42. Which functions generate sequences?

• [ ] range()
• [ ] list()
• [ ] input()
• [ ] int()

43. Valid logical operations?

• [ ] 5 and 3
• [ ] 5 or 2
• [ ] not 0
• []5+5

44. Which can be used to skip code inside a loop?

• [ ] continue
• [ ] break
• [ ] if
• [ ] pass

45. Keywords used inside loops?

• [ ] continue
• [ ] break
• [ ] if
• [ ] elif

Page ______
46. Which combinations will evaluate to True?

• [ ] 5 > 3 and 2 < 4


• [ ] 5 < 3 or 2 < 4
• [ ] not (2 > 5)
• [ ] 5 == 5

47. Operators used for comparison?

• [ ] ==
• [ ] !=
• []>
• [ ] <=

48. Which functions can be used inside loops?

• [ ] print()
• [ ] range()
• [ ] len()
• [ ] sum()

49. Which control structures are for branching?

• [ ] if
• [ ] elif
• [ ] else
• [ ] break

50. Conditions for a loop to run indefinitely?

• [ ] True condition
• [ ] Missing break
• [ ] Constant update
• [ ] Decreasing counter

Page ______

You might also like