programming-fundamentals
  • Introduction
  • Lesson 1
    • Writing Your First Program
    • Data Types
    • Built In Functions
    • If Statements
    • Using Git and Github
    • Primer
    • Questions
    • Tip Calculator
    • GPA Calculator (optional)
  • Lesson 2
    • Modules
    • Lists
    • Data Structures
    • More On Data Structures
    • Questions
    • Madame Zamad
    • Mad Libs
  • Lesson 3
    • While Loops
    • For Loops
    • Loops and Lists
    • Special Commands
    • Questions
    • TODO List
    • Fibonacci (optional)
  • Lesson 4
    • Functions
    • More Functions
    • Error Handling
    • File I/O
    • Questions
    • Sudoku
Powered by GitBook
On this page

Was this helpful?

  1. Lesson 3

Questions

  • What is the difference between a while loop and a for loop?

  • How do you write a while loop?

  • How do you write a for loop?

  • What is a code block?

  • What is an infinite loop?

  • Is it possible to have an infinite for loop?

  • How do you exit an infinite loop if you're in one?

  • What does the range() function do?

  • Give a reason for why you might use the break or continue commands.

  • True or False, the pass command will skip everything until the end of the

    if statement below?

if condition == True:
  pass
  print("should this get printed")
  • Give an example of a 3-dimensional list.

  • True or False, the items in a list maintain the order of when they were added?

  • True or False, the items in a dictionary maintain the order of when they were added?

  • What does the enumerate function do?

  • Try printing out range(10) to see that iterating with numbers is really just

    creating a list to iterate over.

PreviousSpecial CommandsNextTODO List

Last updated 5 years ago

Was this helpful?