Skip to main contentdfsdf

Home/ jwranton's Library/ Images/ Loops | Introduction to Programming | Treehouse

Loops | Introduction to Programming | Treehouse

Clipped from: teamtreehouse.com/...loops

Loops | Introduction to Programming | Treehouse

Embed:

  • aysedogan
    aysedogan on 2026-05-15
    Great clip! For anyone watching this and wondering when to use which loop:
    while loop → when you don't know how many iterations you need (e.g., waiting for user input)
    for loop → when you know the exact count upfront (e.g., running code 10 times)
    Also worth noting: the counter = counter - 1 can be shortened to counter-- in most languages. Small thing, but good to know as you progress! insta pro 2 13.70 apk download

Would you like to comment?

Join Diigo for a free account, or sign in if you are already a member.