Python Medium Practice Problems
1. ATM Withdrawal System
Create a program where:
• User has an initial balance of 10000
• Ask the user to enter withdrawal amount
• If amount is greater than balance → print 'Insufficient Balance'
• If amount is divisible by 100 → allow withdrawal
• Otherwise → print 'Enter amount in multiples of 100'
Also print remaining balance after successful withdrawal.
2. Employee Salary Calculator
Create a salary calculator using functions.
Rules:
• Less than 2 years → no bonus
• 2 to 5 years → 10% bonus
• Above 5 years → 20% bonus
Take:
• Employee name
• Base salary
• Years of experience
Print:
• Employee name
• Bonus amount
• Final salary
3. Find Duplicate Elements in a List
Given:
numbers = [1, 5, 2, 7, 5, 9, 1, 10, 2]
Find all duplicate numbers without using:
• set()
• collections library
Expected Output:
[1, 5, 2]
4. Student Result Management System
Store student marks inside a dictionary.
Example:
students = {
"Arun": [78, 85, 90],
"Priya": [45, 60, 55],
"Kavin": [95, 92, 98]
}
Tasks:
• Calculate average marks of each student
• Print grade:
- A → above 90
- B → above 70
- C → above 50
- Fail → below 50
Also print topper name.
5. Number Guessing Game
Create a number guessing game.
Rules:
• Store a secret number inside the program
• User gets only 5 chances
• For every wrong guess:
- print 'Too High' or 'Too Low'
• If user guesses correctly:
- print 'You Won'
• If all chances finish:
- print 'Game Over'
Bonus:
• Count number of attempts taken to win.