Loops Assignment
Loops Assignment
2. Write a python program to print all natural numbers from 1 to n. - using while loop
3. Write a python program to print all natural numbers in reverse (from n to 1). - using while
loop
4. Write a python program to print all alphabets from a to z. - using while loop
5. Write a python program to print all even numbers between 1 to 100. - using while loop
6. Write a python program to print all odd number between 1 to 100.
7. Write a python program to find sum of all natural numbers between 1 to n.
8. Write a python program to find sum of all even numbers between 1 to n.
9. Write a python program to find sum of all odd numbers between 1 to n.
10. Write a python program to print multiplication table of any number.
11. Write a python program to count number of digits in a number.
12. Write a python program to find first and last digit of a number.
13. Write a python program to find sum of first and last digit 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 print all ASCII character with their values.
19. WAP to print the following pattern:
1 3 5 7 9 …….till 100
20. WAP to print the following pattern
1 3 7 11 13 21… till 100
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 check whether a number is Prime number or not.
25. Write a python program to print all Prime numbers between 1 to n.
26. Write a python program to find sum of all prime numbers between 1 to n.