13/06/2026, 15:46 Welcome To Colab - Colab
Task No:01 Create a line plot showing the change in temperature over 7 days.
import [Link] as plt
days = [1, 2, 3, 4, 5, 6, 7]
temperature = [30, 32, 31, 35, 36, 34, 33]
[Link](days, temperature, marker='o')
[Link]("Temperature Over 7 Days")
[Link]("Days")
[Link]("Temperature (°C)")
[Link](True)
[Link]()
Task No:02 Draw a bar chart to compare marks of 5 students in a class.
import [Link] as plt
students = ["Ali", "Ahmed", "Sara", "Ayesha", "Usman"]
marks = [85, 78, 92, 88, 80]
[Link](students, marks)
[Link]("Marks of Students")
[Link]("Students")
[Link]("Marks")
[Link]()
[Link] 1/6
13/06/2026, 15:46 Welcome To Colab - Colab
Task No:03 Plot a histogram to represents the distribution of students ages in a class.
import [Link] as plt
ages = [18, 19, 20, 18, 21, 20, 19, 18, 22, 20, 19]
[Link](ages, bins=5)
[Link]("Distribution of Students Ages")
[Link]("Age")
[Link]("Frequency")
[Link]()
Task No:04 Create a scatter plot showing relationship between study hours and exam marks.
[Link] 2/6
13/06/2026, 15:46 Welcome To Colab - Colab
import [Link] as plt
study_hours = [1, 2, 3, 4, 5, 6, 7]
marks = [40, 50, 55, 65, 70, 85, 90]
[Link](study_hours, marks)
[Link]("Study Hours vs Exam Marks")
[Link]("Study Hours")
[Link]("Marks")
[Link]()
Task No:05 Draw a pie chart showing the percentage of time spent on daily activites
import [Link] as plt
activities = ["Study", "Sleep", "Sports", "Entertainment"]
hours = [6, 8, 4, 6]
[Link](hours, labels=activities, autopct="%1.1f%%")
[Link]("Daily Activities")
[Link]()
Task No:06 Create a line graph showing monthly sales of a shop for 6 months
import [Link] as plt
[Link] 3/6
13/06/2026, 15:46 Welcome To Colab - Colab
months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"]
sales = [5000, 7000, 6500, 8000, 9000, 8500]
[Link](months, sales, marker='o')
[Link]("Monthly Sales")
[Link]("Months")
[Link]("Sales")
[Link](True)
[Link]()
Task No:07 Plot a bar chart comparing number of books read by different students.
import [Link] as plt
students = ["Ali", "Ahmed", "Sara", "Ayesha", "Usman"]
books = [5, 7, 4, 8, 6]
[Link](students, books)
[Link]("Books Read by Students")
[Link]("Students")
[Link]("Number of Books")
[Link]()
Task No:08 Create a scatter plot to show height vs weight of students in a class.
[Link] 4/6
13/06/2026, 15:46 Welcome To Colab - Colab
import [Link] as plt
height = [150, 155, 160, 165, 170, 175]
weight = [45, 50, 55, 60, 65, 70]
[Link](height, weight)
[Link]("Height vs Weight")
[Link]("Height (cm)")
[Link]("Weight (kg)")
[Link]()
Task No:09 Draw a pie chart showing favorite subjects of students in a class.
import [Link] as plt
subjects = ["Math", "Science", "English", "Computer", "Urdu"]
students = [10, 8, 6, 12, 4]
[Link](students, labels=subjects, autopct="%1.1f%%")
[Link]("Favorite Subjects of Students")
[Link]()
Task No:010 Create a combined line plot showing profit and loss of a company over 5 years.
import [Link] as plt
years = [2021 2022 2023 2024 2025]
[Link] 5/6
13/06/2026, 15:46 Welcome To Colab - Colab
years = [2021, 2022, 2023, 2024, 2025]
profit = [5000, 7000, 9000, 12000, 15000]
loss = [2000, 1500, 3000, 2500, 1000]
[Link](years, profit, marker='o', label="Profit")
[Link](years, loss, marker='s', label="Loss")
[Link]("Profit and Loss Over 5 Years")
[Link]("Years")
[Link]("Amount")
[Link]()
[Link](True)
[Link]()
[Link] 6/6