0% found this document useful (0 votes)
31 views

List of programs on loops

Uploaded by

ramyacreative5
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

List of programs on loops

Uploaded by

ramyacreative5
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

List of loop programming exercises

1. Write a Python program to print all natural numbers from 1 to n. - using while loop
2. Write a Python program to print all natural numbers in reverse (from n to 1). -
using while loop
3. Write a Python program to print all alphabets from a to z. - using while loop
4. Write a Python program to print all even numbers between 1 to 100. - using while loop
5. Write a Python program to print all odd number between 1 to 100.
6. Write a Python program to find sum of all natural numbers between 1 to n.
7. Write a Python program to find sum of all even numbers between 1 to n.
8. Write a Python program to find sum of all odd numbers between 1 to n.
9. Write a Python program to print multiplication table of any number.
10. Write a Python program to count number of digits in a number.
11. Write a Python program to find first and last digit of a number.
12. Write a Python program to find sum of first and last digit of a number.
13. Write a Python program to swap first and last digits of a number.
14. Write a Python program to calculate sum of digits of a number.
15. Write a Python program to calculate product of digits of a number.
16. Write a Python program to enter a number and print its reverse.
17. Write a Python program to check whether a number is palindrome or not.
18. Write a Python program to find frequency of each digit in a given integer.
19. Write a Python program to enter a number and print it in words.
20. Write a Python program to print all ASCII character with their values.
21. Write a Python program to find power of a number using for loop.
22. Write a Python program to find all factors of a number.
23. Write a Python program to calculate factorial of a number.
24. Write a Python program to find HCF (GCD) of two numbers.
25. Write a Python program to find LCM of two numbers.
26. Write a Python program to check whether a number is Prime number or not.
27. Write a Python program to print all Prime numbers between 1 to n.
28. Write a Python program to find sum of all prime numbers between 1 to n.
29. Write a Python program to find all prime factors of a number.
30. Write a Python program to check whether a number is Armstrong number or not.
31. Write a Python program to print all Armstrong numbers between 1 to n.
32. Write a Python program to check whether a number is Perfect number or not.
33. Write a Python program to print all Perfect numbers between 1 to n.
34. Write a Python program to check whether a number is Strong number or not.
35. Write a Python program to print all Strong numbers between 1 to n.
36. Write a Python program to print Fibonacci series up to n terms.
37. Write a Python program to find one's complement of a binary number.
38. Write a Python program to find two's complement of a binary number.
39. Write a Python program to convert Binary to Octal number system.
40. Write a Python program to convert Binary to Decimal number system.
41. Write a Python program to convert Binary to Hexadecimal number system.
42. Write a Python program to convert Octal to Binary number system.
43. Write a Python program to convert Octal to Decimal number system.
44. Write a Python program to convert Octal to Hexadecimal number system.
45. Write a Python program to convert Decimal to Binary number system.
46. Write a Python program to convert Decimal to Octal number system.
47. Write a Python program to convert Decimal to Hexadecimal number system.
48. Write a Python program to convert Hexadecimal to Binary number system.
49. Write a Python program to convert Hexadecimal to Octal number system.
50. Write a Python program to convert Hexadecimal to Decimal number system.
51. Write a Python program to print Pascal triangle upto n rows.
52. Star pattern programs - Write a Python program to print the given star patterns.
53. Number pattern programs - Write a Python program to print the given number patterns.

You might also like