02 Loop
02 Loop
PYTHON
PYTHON
13. Write a Python program to swap the first and last digits of a
number using a while loop.
14. Write a Python program to calculate the sum of the digits of a
number using a while loop.
15. Write a Python program to calculate the product of the digits of
a number using a while loop.
16. Write a Python program to enter a number and print its reverse
using a while loop.
17. Write a Python program to check whether a number is a
palindrome or not using a while loop.
18. Write a Python program to find the frequency of each digit in a
given integer using a while loop.
19. Write a Python program to enter a number and print it in words
using a while loop.
20. Write a Python program to print all ASCII characters with their
values using a while loop.
21. Write a Python program to find the power of a number using a
for loop.
22. Write a Python program to find all factors of a number using a
while loop.
23. Write a Python program to calculate the factorial of a number
using a while loop.
24. Write a Python program to find the HCF (GCD) of two numbers
using a while loop.
25. Write a Python program to find the LCM of two numbers using
a while loop.
26. Write a Python program to check whether a number is a prime
number or not using a while loop.
PYTHON
27. Write a Python program to print all prime numbers between 1
to n using a while loop.
28. Write a Python program to find the sum of all prime numbers
between 1 to n using a while loop.
29. Write a Python program to find all prime factors of a number
using a while loop.
30. Write a Python program to check whether a number is an
Armstrong number or not using a while loop.
31. Write a Python program to print all Armstrong numbers
between 1 to n using a while loop.
32. Write a Python program to check whether a number is a perfect
number or not using a while loop.
33. Write a Python program to print all perfect numbers between 1
to n using a while loop.
34. Write a Python program to check whether a number is a strong
number or not using a while loop.
35. Write a Python program to print all strong numbers between 1
to n using a while loop.
36. Write a Python program to print the Fibonacci series up to n
terms using a while loop.
37. Write a Python program to print Pascal's triangle up to n rows
using a for loop.
38. Write Python programs to print various star patterns using
while loops.
39. Write Python programs to print various number patterns using
while loops.
40. Write a Python program that asks the user for a positive integer
'n' and calculates the sum of all numbers from 1 to 'n'.
PYTHON
41. Create a program that takes a list of numbers as input and
counts how many of them are even and how many are odd.
42. Design a program that prompts the user to enter the scores of
students. Determine and display their grades (A, B, C, D, or F) based
on the average score.
43. Write a script that simulates a password entry. Allow the user
three attempts to enter the correct password. If the correct password
is entered, print a success message; otherwise, display a failure
message.
44.Write a Python program that generates prime numbers within a given
range. Allow the user to input the range and then display the prime
numbers found.
PYTHON