Thursday, December 11, 2025

🎯 Projects with Python

 

🎯 1. Temperature Chart Project

✔ Goal

Plot daily temperatures for one week.

✔ Code

import matplotlib.pyplot as plt days = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] temp = [30, 32, 31, 29, 35, 36, 34] plt.figure(figsize=(8, 4)) plt.plot(days, temp, marker='o') plt.title("Weekly Temperature Chart") plt.xlabel("Days") plt.ylabel("Temperature (°C)") plt.grid(True) plt.show()

🎯 2. Student Marks Bar Chart

✔ Goal

Show marks of 5 students using a bar graph.

✔ Code

import matplotlib.pyplot as plt students = ["A", "B", "C", "D", "E"] marks = [78, 85, 90, 70, 88] plt.figure(figsize=(8, 4)) plt.bar(students, marks) plt.title("Student Marks Comparison") plt.xlabel("Students") plt.ylabel("Marks") plt.show()

🎯 3. Pie Chart of Mobile Brands Market Share

✔ Goal

Display percentage of mobile brands.

✔ Code

import matplotlib.pyplot as plt brands = ["Samsung", "Apple", "Xiaomi", "OnePlus"] share = [30, 25, 20, 25] plt.figure(figsize=(6, 6)) plt.pie(share, labels=brands, autopct="%1.1f%%") plt.title("Mobile Market Share") plt.show()

🎯 4. Line Chart of Monthly Expenses

✔ Goal

Visualize how personal monthly expenses change.

✔ Code

import matplotlib.pyplot as plt months = ["Jan","Feb","Mar","Apr","May","Jun"] expense = [12000, 14000, 13000, 15000, 16000, 15500] plt.figure(figsize=(10,4)) plt.plot(months, expense, marker='o') plt.title("Monthly Expense Trend") plt.xlabel("Months") plt.ylabel("Expense (INR)") plt.grid(True) plt.show()

🎯 5. Scatter Plot for Study Hours vs Marks

✔ Goal

Show if more study hours leads to more marks.

✔ Code

import matplotlib.pyplot as plt study_hours = [1, 2, 3, 4, 5, 6, 7] marks = [50, 55, 60, 65, 70, 80, 90] plt.figure(figsize=(7,5)) plt.scatter(study_hours, marks) plt.title("Study Hours vs Marks") plt.xlabel("Study Hours") plt.ylabel("Marks") plt.show()

🎯 6. Project: Sales Analysis Chart

✔ Goal

Plot sales data for 6 months.

✔ Code

import matplotlib.pyplot as plt months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"] sales = [10000, 12000, 15000, 14000, 17000, 18000] plt.figure(figsize=(9,4)) plt.bar(months, sales) plt.title("Monthly Sales Analysis") plt.xlabel("Months") plt.ylabel("Sales Amount") plt.show()

🎯 7. Histogram of Student Ages

✔ Goal

Plot distribution of ages.

✔ Code

import matplotlib.pyplot as plt ages = [17,18,18,19,19,20,17,18,21,22,19,18] plt.figure(figsize=(7,4)) plt.hist(ages, bins=5) plt.title("Age Distribution of Students") plt.xlabel("Age") plt.ylabel("Frequency") plt.show()

🎯 8. Covid Cases Visualization

✔ Goal

Plot daily covid cases trend.

✔ Code

import matplotlib.pyplot as plt days = [1,2,3,4,5,6,7] cases = [100, 150, 200, 180, 220, 300, 350] plt.figure(figsize=(10,4)) plt.plot(days, cases, marker='o') plt.title("COVID-19 Cases Trend") plt.xlabel("Day") plt.ylabel("Cases") plt.grid(True) plt.show()

🎯 9. Simple Sine Wave Plot

✔ Goal

Plot a mathematical sine wave.

✔ Code

import matplotlib.pyplot as plt import numpy as np x = np.linspace(0, 10, 100) y = np.sin(x) plt.figure(figsize=(8,4)) plt.plot(x, y) plt.title("Sine Wave") plt.xlabel("X") plt.ylabel("sin(x)") plt.grid(True) plt.show()

🎯 10. Budget Tracker Bar + Line Mix

✔ Goal

Show income vs expenses together.

✔ Code

import matplotlib.pyplot as plt months = ["Jan","Feb","Mar","Apr"] income = [30000, 35000, 32000, 37000] expense = [20000, 25000, 26000, 28000] plt.figure(figsize=(10,5)) plt.bar(months, income) plt.plot(months, expense, marker='o') plt.title("Income & Expense Comparison") plt.xlabel("Months") plt.ylabel("Amount (INR)") plt.show()

No comments:

Post a Comment

Python Viva Questions

  Basic Python Viva Questions 1. What is Python? Python is a high-level, interpreted, and object-oriented programming language used for w...