Python Programming Question Paper
Topics: Looping and Conditional Statements
1. Write a Python program to find the sum of all even numbers between 1 and 100 using a
while loop.
2. Using nested loops, print a pyramid pattern of stars with height equal to a user-given
number.
3. Write a program to find all prime numbers between 1 and 200 without using any built-in
functions.
4. Given a list of integers, use a for loop to create a new list containing only the squares of
numbers that are divisible by 3.
5. Use a loop and conditional statements to simulate a simple login system that gives the
user only three attempts.
6. Write a program that prints the Fibonacci sequence up to N terms using a while loop.
7. Without using ‘max()’, write a loop to find the largest number in a given list.
8. Given an integer, check if it is an Armstrong number using a while loop.
9. Write a program that continuously asks the user to enter numbers until they type ‘done’,
then print the average of all numbers entered.
10. Using nested loops, print the multiplication table for numbers 1 to 10 in a formatted
way.
11. Create a program to count how many vowels are in a user-entered string using a for
loop.
12. Given a list of numbers, use a loop to separate even and odd numbers into two
different lists.
13. Write a Python program to print all numbers from 1 to 100, but replace multiples of 3
with ‘Fizz’, multiples of 5 with ‘Buzz’, and multiples of both with ‘FizzBuzz’.
14. Create a program using loops that reverses a number (e.g., input 1234 → output
4321).
15. Write a program that checks whether a given number is a palindrome without
converting it to a string.
16. Use a for loop to display all the factors of a given number.
17. Write a loop that takes a sentence and counts how many words contain more than 5
letters.
18. Using loops, find and print all pairs of numbers (x, y) from 1–50 such that x² + y² = 100.
19. Create a menu-driven program using while loops and conditionals for a simple
calculator (add, subtract, multiply, divide).
20. Write a Python program using loops to check if two strings are anagrams of each
other.