50+ Most Asked Loop Questions (Python)
1. Print numbers from 1 to N.
2. Print even numbers between 1 and 100.
3. Print odd numbers between 1 and 100.
4. Find the sum of numbers from 1 to N.
5. Find the factorial of a number.
6. Print multiplication table of a number.
7. Print all numbers in reverse from N to 1.
8. Reverse a number.
9. Reverse a string.
10. Check if a number is palindrome.
11. Check if a string is palindrome.
12. Print Fibonacci series up to N terms.
13. Find the sum of digits of a number.
14. Find the product of digits of a number.
15. Count digits in a number.
16. Print all prime numbers between 1 and 100.
17. Check if a number is prime.
18. Print pyramid pattern of stars.
19. Print inverted pyramid pattern.
20. Print right angle triangle of numbers.
21. Print hollow rectangle pattern.
22. Print diamond pattern of stars.
23. Find GCD (HCF) of two numbers.
24. Find LCM of two numbers.
25. Count vowels and consonants in a string.
26. Find the largest digit in a number.
27. Find the smallest digit in a number.
28. Check if a number is Armstrong number.
29. Find all Armstrong numbers between 1 and 1000.
30. Print Pascal's triangle up to N rows.
31. Print ASCII value of each character in a string.
32. Print sum of even and odd numbers separately from 1 to N.
33. Swap two numbers without using a third variable (loop logic).
34. Print a checkerboard pattern of size N x N.
35. Count spaces, digits, and alphabets in a string.
36. Print all perfect numbers between 1 and 1000.
37. Find the sum of series: 1 + 2 + 4 + 8 + ... + N terms.
38. Find the sum of series: 1! + 2! + 3! + ... + N!
39. Print hollow triangle pattern.
40. Print a solid rectangle of numbers.
41. Print a cross (X) pattern of stars.
42. Print Floyd's triangle.
43. Print a butterfly pattern.
44. Find power of a number using loops (a^b).
45. Print numbers in the following pattern: 1, 12, 123, ...
46. Print reverse Floyd's triangle.
47. Print concentric square number pattern.
48. Print zig-zag star pattern.
49. Print alternate even and odd numbers up to N.
50. Print a pattern of increasing and decreasing numbers.
51. Print a pattern of stars with spaces: * *