Python loop exercises
Practice for and while loops on problems that check your answer with tests as soon as you submit.
Beginner
Intermediate
- 16. Sum of DigitsAdd up the digits of a number55 XP5 min
- 20. FactorialThe product of every number up to n65 XP6 min
- 21. Fibonacci SequenceThe sequence where each number adds the two before70 XP7 min
- 22. FizzBuzzFizz, Buzz or a number: the classic counting game75 XP8 min
- 23. Prime Number CheckIs this number divisible only by 1 and itself?80 XP8 min
- 270. Happy NumbersSome numbers find their way to 1, others wander in circles forever60 XP10 min
Other topics
- Python Basics
- Strings
- Lists
- Dictionaries and sets
- Functions
- Math
- Sorting and searching
- Two pointers
- Sliding window
- Stacks and queues
- Recursion and backtracking
- Dynamic programming
- Greedy
- Graphs
- Trees
- Bit manipulation
- Classes
- Iterators and generators
- Parsing
- Simulation
- Python idioms
- Regular expressions
- Codes and ciphers
- Working with data
- Grids and matrices
- Geometry
- Games and puzzles
- Heaps
- Data structures
Or see every challenge, with study plans, today's challenge and duels.