Loops (for, while)

  1. Write a Python program to display the first N natural numbers using a for loop ?
  2. Write a Python program to calculate the factorial of a given number using a while loop ?
  3. Write a Python program to display the multiplication table of a given number using a for loop ?
  4. Write a Python program to find the sum of digits of a given number using a while loop ?
  5. Write a Python program to display the Fibonacci series up to N terms using a loop ?
  6. Write a Python program to find all prime numbers within a given range using loops ?
  7. Write a Python program to check whether a given number is an Armstrong number using loops ?
  8. Write a Python program to generate Pascal’s Triangle for N rows using nested loops ?
  9. Write a Python program to find all perfect numbers within a given range using loops ?
  10. Write a Python program to simulate an ATM system using a menu-driven approach and loops ?
Previous Topic Conditional Statements (if, elif, else) Next Topic control keywords (break, continue, pass)