Python Loop Questions (Easy, Medium, Hard)
Easy Level (Beginner)
1. Print numbers from 1 to 10 using a for loop.
2. Print all even numbers from 2 to 20 using a while loop.
3. Print the first 5 characters of a string using a for loop.
4. Use a loop to calculate the sum of numbers from 1 to 50.
5. Print numbers 1 to 10, but skip 5 using continue.
Medium Level (Intermediate)
1. Print a multiplication table of 7 using a for loop.
2. Reverse a string using a while loop.
3. Print a triangle pattern using nested loops:
*
**
***
****
4. Print all numbers from 1 to 50, but stop the loop when a number is divisible by 13
using break.
5. Print numbers 1 to 100, but print "Fizz" for multiples of 3, "Buzz" for multiples of
5, and "FizzBuzz" for multiples of both using a loop.
Hard Level (Advanced)
1. Print a pyramid pattern with numbers (height = 5):
1
121
12321
1234321
123454321
2. Use a nested loop to print a multiplication table (1–10) in a formatted way.
3. Find the factorial of a number without using the math module using a loop.
4. Print all prime numbers from 1 to 100 using a nested loop.
1
5. Create a number guessing game using a while loop, where the user keeps guessing until they get
the correct number.