Python Loops Practice Questions
1. Print numbers from 1 to 100 using a loop.
2. Print numbers from 100 to 1.
3. Print all even numbers from 1 to 100.
4. Print all odd numbers from 1 to 100.
5. Print multiplication table of a given number n.
6. Find sum of numbers from 1 to n.
7. Find factorial of a number.
8. Count digits in a number.
9. Reverse a number.
10. Check if a number is palindrome.
11. Find the largest digit in a number.
12. Find sum of digits of a number.
13. Check if a number is Armstrong.
14. Print Fibonacci series up to n terms.
15. Check if a number is prime.
16. Print all prime numbers from 1 to 100.
17. Count number of prime numbers in a range.
18. Find GCD of two numbers using loops.
19. Find LCM of two numbers using loops.
20. Print factors of a number.
21. Print star pattern increasing.
22. Print star pattern decreasing.
23. Print pyramid pattern.
24. Print number increasing pattern.
25. Print repeating number pattern.
26. Print Floyd’s Triangle.
27. Print Pascal’s Triangle.
28. Print hollow square pattern.
29. Print diamond pattern.
30. Print inverted pyramid.
31. Find all Armstrong numbers between 1 to 1000.
32. Print all perfect numbers in a range.
33. Check if a number is a strong number.
34. Convert decimal to binary using loops.
35. Convert binary to decimal using loops.
36. Find sum of series: 1 + 1/2 + ... + 1/n.
37. Find sum of series: 1² + 2² + ... + n².
38. Reverse a string using loop.
39. Count vowels and consonants in a string.
40. Remove duplicates from a list using loop.
41. Print all pairs whose sum equals target.
42. Find second largest number in a list.
43. Rotate list by k positions.
44. Find missing number in sequence.
45. Check if two strings are anagrams.
46. Print frequency of each element in list.
47. Find longest increasing subsequence (basic).
48. Simulate ATM menu using loop.
49. Guess the number game.
50. Print alphabet pattern (A, AB, ABC...).