Python Exercises (20 Questions –
Beginner to Intermediate)
1. Fibonacci Sequence Generator
Write a function to return the first n numbers in the Fibonacci
sequence.
2. Palindrome Checker
Check if a given word is a palindrome.
3. Word Frequency Counter
Count how many times each word appears in a sentence.
4. Even and Odd Splitter
Separate a list of integers into two lists: one with even numbers
and one with odd.
5. List Reverser Without Built-ins
Reverse a list without using .reverse() or slicing.
6. Multiplication Table Printer
Print a multiplication table (e.g., from 1 to 10) in a grid format.
7. Unique Elements from a List
Take a list with duplicates and return a list of only the unique
elements.
8. Caesar Cipher Encoder
Encrypt a message by shifting each letter by a fixed number of
positions in the alphabet.
9. Sum of Digits
Given an integer, return the sum of its digits.
10. Find the Missing Number
From a list of numbers 1 to n with one missing, find the missing
number.
11. Number Guessing Game
Create a game where the user has to guess a randomly generated
number.
12. Simple Calculator
Build a calculator that can perform addition, subtraction,
multiplication, and division.
13. Count Vowels in a String
Return the number of vowels in a given string.
14. Second Largest Number
Find the second largest number in a list.
15. Merge Two Sorted Lists
Write a function to merge two already sorted lists into one sorted
list.
16. Longest Word Finder
Find the longest word in a sentence entered by the user.
17. Character Frequency in a String
Count how many times each character appears in a string.
18. Capitalize Each Word
Capitalize the first letter of each word in a given sentence.
19. Find All Prime Numbers up to N
Write a function that returns all prime numbers less than or equal
to n.
20. Check for Anagram
Determine if two input words are anagrams of each other.
DO WHAT YOU CAN,
WITH WHAT YOU HAVE,
WHERE YOU ARE.
[ROOSEVELT]