Must-do problems: Loops
90 min ยท Beginner
Need help? Ask a tutor on WhatsApp (opens in a new tab)These are the loop problems every Python beginner should be able to solve, from a simple countdown to prime factors and a centred pyramid. Trace each one on paper with a small input first, then check your program against every test.
What you will learn
What you will learn
- Choose between while and for for a task
- Work with digits using % 10 and // 10
- Stop a loop with break and test for primes with for-else
- Build star patterns with loops and string repetition
Sign in to continue this lesson
Create an account to read every lesson, practise with the exercises and keep track of your progress.