Knowledge check

Python Programming for Application Development: Practical Python for Technology Professionals
Lesson Content
0% Complete

Q1. What is the main benefit of using a loop?

  • It makes code repeat actions automatically
  • It deletes variables
  • It changes Python into a database
  • It prevents all errors
Reveal answer

Answer: It makes code repeat actions automatically
Loops save time and reduce repetitive code by repeating an action for each item or until a condition changes.


Q2. A list is used to store multiple related values.

  • True
  • False
Reveal answer

Answer: True
Lists are collections that can hold several items in order.


Q3. Which loop is commonly used when you want to process each item in a list?

  • for loop
  • if loop
  • try loop
  • return loop
Reveal answer

Answer: for loop
A for loop is designed to go through items in a collection one by one.