0% found this document useful (0 votes)
3 views5 pages

Python Practice Problems

The document outlines 20 real-life Python practice problems and 10 end-to-end projects using NumPy, Pandas, and Matplotlib. The practice problems include tasks such as creating a personal budget tracker, a student grade book, and a password strength checker, while the projects focus on data analysis and visualization, such as a student performance analyzer and a COVID-19 data tracker. Each project aims to enhance data science skills through practical applications of data loading, numerical analysis, and visualization.

Uploaded by

oryoniro
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views5 pages

Python Practice Problems

The document outlines 20 real-life Python practice problems and 10 end-to-end projects using NumPy, Pandas, and Matplotlib. The practice problems include tasks such as creating a personal budget tracker, a student grade book, and a password strength checker, while the projects focus on data analysis and visualization, such as a student performance analyzer and a COVID-19 data tracker. Each project aims to enhance data science skills through practical applications of data loading, numerical analysis, and visualization.

Uploaded by

oryoniro
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

20 Real-Life Python Practice Problems

(Instruction-Only)
1. Personal Budget Tracker
 Create a program that asks the user to input monthly expenses.
 Store each entry with a category and amount (e.g., Food: 500).
 Use a dictionary to summarize total expenses per category.
 At the end of the month, display total expenses and identify the category with the
highest spending.

2. Student Grade Book


 Design a program that records students’ names and their marks.
 Use a dictionary where keys are student names and values are lists of marks.
 Allow the user to input multiple subjects.
 Calculate the average and highest score per student.

3. BMI Calculator
 Ask the user to input height (in meters) and weight (in kg).
 Calculate BMI using the formula (weight / height^2).
 Print the BMI and categorize it (Underweight, Normal, Overweight, Obese).

4. Password Strength Checker


 Prompt the user to input a password.
 Check for the presence of uppercase, lowercase, numbers, and special characters using
regex.
 Categorize the password as Weak, Moderate, or Strong.

5. Daily Habit Tracker


 Let the user enter habits and mark them as complete or incomplete.
 Use a list or dictionary to store habit names and status.
 At the end of the day, show how many habits were completed.
 Optionally visualize using a simple text-based progress bar.

6. Temperature Converter
 Allow the user to input temperature and select conversion (Celsius to Fahrenheit or vice
versa).
 Use conditional statements and formulae to convert values.
 Loop the prompt until the user exits.

7. Simple To-Do List


 Create a menu with options: add task, remove task, view tasks.
 Store tasks in a list.
 Use a loop to keep the program running until the user chooses to exit.

8. Number Guessing Game


 Generate a random number between 1 and 100.
 Prompt the user to guess the number.
 Provide hints whether the guess is too high or low.
 Count the number of attempts.

9. Palindrome Checker
 Ask the user to input a word or phrase.
 Remove spaces and convert to lowercase.
 Check if it reads the same backward.

10. Word Frequency Counter


 Accept a block of text from the user.
 Split it into words and count how many times each word appears.
 Display the most frequent words in descending order.

11. Library Management System (Basic)


 Create a Book class with attributes like title, author, and availability.
 Store a collection of books using a list or dictionary.
 Allow the user to add new books, borrow, return, and view available books.
 Update the availability status accordingly.

12. Weather Report Visualizer


 Prepare a sample CSV file with weather data (date, temperature, humidity).
 Load the data using pandas.
 Allow the user to select a date range or specific column to analyze.
 Plot a line graph of temperature changes using matplotlib.

13. Survey Analyzer


 Design a small dataset that simulates survey responses.
 Load the data with pandas.
 Count how many people chose each answer and group by gender or age.
 Visualize the findings with bar or pie charts.

14. Typing Speed Test


 Present a fixed sentence to the user.
 Record the time when the user starts and ends typing.
 Calculate words per minute and typing accuracy.
 Display the results.
15. Simple Calculator (GUI Optional)
 Present a menu of operations (add, subtract, multiply, divide, etc.).
 Ask for two inputs and perform the selected operation.
 Loop the program to allow multiple calculations.

16. Movie Ratings Aggregator


 Create a dictionary or DataFrame to store movies and their ratings.
 Allow users to input ratings (1–5) for movies.
 Calculate average ratings and sort top-rated movies.

17. Customer Feedback Cleaner and Analyzer


 Input or upload raw customer feedback.
 Clean the text using regex (remove special characters, lowercase).
 Count keyword appearances and use sets for unique phrases.

18. Expense Categorizer


 Input expense entries like 'Groceries 1200'.
 Extract category and amount and store in a dictionary.
 Calculate total per category and visualize with a pie chart.

19. Schedule Reminder Tool


 Map days of the week to tasks using a dictionary.
 Allow users to add, update, view, and remove tasks.
 Loop through menu options until exit.

20. Email Validator and Cleaner


 Input a list of email addresses.
 Validate format using regex and remove duplicates with sets.
 Separate valid and invalid emails and optionally export the list.

10 End-to-End Projects Using NumPy, Pandas, and Matplotlib

1. Student Performance Analyzer

 Load student grades from a CSV file.


 Use NumPy to calculate average, highest, and lowest scores.
 Visualize student scores using a bar chart.
 Group performance by subject.

2. Sales Dashboard

 Load monthly sales data.


 Compute total revenue, average sales, and top products.
 Use line and pie charts for sales trends and contributions.
 Apply NumPy datetime functions for seasonal analysis.

3. Weather Report Visualizer

 Load weather data (temperature, humidity) from a CSV.


 Filter data by a specific date range.
 Plot temperature and humidity using line graphs.
 Use NumPy to calculate moving averages.

4. COVID-19 Data Tracker

 Load worldwide COVID-19 data (cases, deaths, recoveries).


 Compute death and recovery rates.
 Compare countries using grouped bar charts.
 Normalize data using NumPy for fair comparison.

5. Stock Price Analyzer

 Load historical stock price data.


 Calculate daily returns, moving averages, and volatility.
 Visualize price trends with moving average overlays.
 Analyze standard deviation using NumPy.

6. E-commerce Product Review Analyzer

 Load product reviews with ratings.


 Compute average rating per product.
 Plot a histogram of ratings.
 Identify top and bottom reviewed products.

7. Population Growth Visualization

 Load country-wise population data by year.


 Calculate annual growth rates using NumPy.
 Plot growth trends using line charts.
 Highlight fast-growing countries with annotations.
8. Expense Tracker

 Load expense records (date, category, amount).


 Group expenses by category and calculate totals.
 Plot category-wise expenses with pie charts.
 Analyze monthly trends with line graphs.

9. Iris Dataset Visual Explorer

 Load the Iris dataset.


 Compute statistical summaries (mean, median, std) using NumPy.
 Use scatter plots to explore petal and sepal dimensions.
 Create box plots to compare features across species.

10. Air Quality Index (AQI) Monitor

 Load AQI sensor data.


 Filter data by city or date range.
 Plot AQI trends with reference lines for good/moderate/hazardous levels.
 Smooth data using NumPy moving averages.

Each project helps build real-world data science skills by combining data loading
(Pandas), numerical analysis (NumPy), and visualization (Matplotlib).

You might also like