Page 11 - IPP-12-2025
P. 11

SECTION D (2 x 4 = 8 Marks)
             33.  Manish, a researcher, is analyzing air quality index (AQI) data over 6 months for a city. The  AQI data is
                 as follows:                                                                              [4]

                                                     Months          AQI
                                                     January         120
                                                    February         110
                                                     March           130
                                                      April          100
                                                      May             95
                                                      June            90
                 Help Manish to complete the following Python code to generate the line chart:




























                 import        as plt # Statement 1
                 months = ['January', 'February', 'March', 'April', 'May', 'June']
                 aqi = [120, 110, 130, 100, 95, 90]
                 plt.plot(months,          ,color='green’, marker='s',label='AQI') # Statement 2

                 plt.xlabel('Months')
                 plt.ylabel('  ') # Statement 3
                 plt.legend()
                 plt.title('  ') # Statement 4
                 plt.show()
                 (a)  Write a suitable code for the import statement in the blank space against Statement 1.
                 (b)  Refer to the graph and fill in the blank against Statement 2 with a suitable Python code.
                  (c)  Fill in the blank against Statement 3 with a suitable label for the y-axis.
                 (d)  Refer to the graph and fill in the blank against Statement 4 with a suitable Chart Title.
            Ans.  (a)  import matplotlib.pyplot as plt
                 (b)  plt.plot(months, aqi, color='green', marker='s', label='AQI')
                  (c)  plt.ylabel('Air Quality Index (AQI)')
                 (d)  plt.title('Monthly AQI Levels')



            M.8          Informatics Practices with Python–XII
   6   7   8   9   10   11   12   13   14   15   16