/**/ Sanjeev Study Hub – Class 11 & 12 Notes, Question Papers, IP & CS Study Material

Wednesday, August 3, 2022

IP SAMPLE PAPER - 2022-23

 CLASS - XII

SAMPLE PAPER (IP )

UNIT TEST PAPER - 2022-23

                                                                                                                                                                                                                                                                                                                       M.M. 20

Q.1 Create horizontal bar chart:                                                                                     1

(a) bar()

(b) barh()

(c) plot()

(d) scatter()

Q.2 Which Pyplot module you can create histogram?                                               1

(a) plot()

(b) bar()

(c) hist()

(d) boxplot()

3. The plot method on Series and DataFrame is just a simple wrapper around ____________.                                                                                                                  1
a) gplt.plot()
b) plt.plot()
c) plt.plotgraph()
d) none of the mentioned

4. Which of the following plots are often used for checking randomness in time series?                                                                                                                             1
a) Autocausation
b) Autorank
c) Autocorrelation
d) None of the mentioned

Q.5 Write a program to plot a line chart to depict the changing weekly onion price for four weeks. Give appropriate axes labels.                                                                   3

import matplotlib.pyplot as plt

Week = [1,2,3,4]

Prices = [40, 80, 100, 50

plt.plot(Week, Prices)

plt.xlabel(‘week’)

plt.ylabe(‘Onion price’)

plt.show()

Q.6 Marks is a list that stores marks of a student in 10 unit tests. Write a program to plot the student’s performance in these 10 unit tests.                                           3                      

import matplotlib.pyplot as plt

Week=[1,2,3,4,5,6,7,8,9,10]

Marks – [12,10,10,15,17,25,12,22,35,40]

plt.plot(Week, Marks)

plt.xlabel(‘week’)

plt.ylabe(‘Unit Test Marks’)

plt.show()

 

Q.7 Write a program to plot a horizontal bar chart from the height of 5 students.     3

import matplotlib.pyplot as plt

Height = [ 5.1, 5.5, 6.0, 5, 6.3]

Names = [‘Arti’, ‘Rama’, ‘Vindo’, ‘Rakesh’, ‘Nisha’]

plt.barh(Names, Height)

plt.xlabel(‘Height’)

plt.ylabel(‘Names’)

plt.show()

Q.8 Write a program to plot a bar chart from the medals won by India. Make sure that the Gold, Silver, Bronze and Total tally is represented through different widths and different colors.                                                                                                              3                      

Medals

Gold

Silver

Bronze

Total

India

90

60

60

210

 

import matplotlib.pyplot as plt

Medal = [‘Gold’, ‘Silver’, ‘Bronze’, ‘Total’]

India = [90,60,60,210]

plt.bar(Medal, India, width =[0.7, 0.5, 0.3, 1, color =[‘gold’, ‘silver’, ‘brown’, ‘black’]

plt.xlabel(‘Medel Type’)

plt.ylabel(‘India Medal count’)

plt.show()

Q.9 Create an array A in the range 1 to 20 with values 1.15 apart. Another array B, contains the log values of the elements in the array A.

Write a program to create a scatter plot of first vs. Second array (array A vs. B) with red circles markers ; specify the x-axis (containing first array’s values) title as ‘Random Values’ and y-axis  title as ‘Logarithm Values.                                                            4                             

import numpy as np

import matplotlib.pyplot as plt

A = np.arange(1,20, 1.25)

B = np.log(A)

plt.plot(A, B, ‘ro’)

plt.xlabel(‘Random Values’)

plt.ylabe(‘Logarithm Values’)

plt.show()


================================


Friday, July 15, 2022

PYTHON PROGRAMS FOR CLASS - XI

 Python Programs

Informatics Practices (065)

=============================

1. WAP in Python to Find the Square Root of any number

a = float(input('Enter a number: '))

sqrt = a ** 0.5

print('The square root of ',a, 'is',sqrt)

-------------------------------------

2. WAP in Python to Calculate the Area of a Triangle (Heron’s Method)

a = float(input('Enter first side: '))

b = float(input('Enter second side: '))

c = float(input('Enter third side: '))

# Calculate the semi-perimeter

s = (a + b + c) / 2

# Calculate the area

area = (s*(s-a)*(s-b)*(s-c)) ** 0.5

print('The area of the triangle is ', area)

--------------------------------------


3. WAP in Python to Generate a Random Number

# import the random module

import random

print(random.randint(1,20))

----------------------------------------

4. WAP in Python to Check if a Number is Even or Odd

num = int(input("Enter a number: "))

if (num % 2) == 0:

   print(num, "is Even")

else:

   print(num, "is Odd")

--------------------------------------

5. WAP in Python to Print all Prime Numbers in an Interval

lower = int(input('Enter the lower number :'))

upper = int(input('Enter the upper number :'))

print("Prime numbers between", lower, "and", upper, "are:")

for num in range(lower, upper + 1):

   # all prime numbers are greater than 1

   if num > 1:

       for i in range(2, num):

           if (num % i) == 0:

               break

       else:

           print(num)

-------------------------------------------------

6. WAP to Print the Fibonacci sequence of n-terms

nterms = int(input("How many terms? "))

a1, a2 = 0, 1

count = 0

if nterms <= 0:

   print("Please enter a valid number")

elif nterms == 1:

   print("Fibonacci sequence upto",nterms,":")

   print(a1)

else:

   print("Fibonacci sequence of", nterms, 'numbers')

   while count < nterms:

       print(a1)

       nth = a1 + a2

       a1 = a2

       a2 = nth

       count += 1


7. WAP to Find the Factorial of any Number

num = int(input("Enter any number: "))

factorial = 1

if num < 0:

   print("Sorry, this is negative number")

elif num == 0:

   print("The factorial of 0 is 1")

else:

   for i in range(1,num + 1):

       factorial = factorial*i

   print("The factorial of",num,"is",factorial)

--------------------------------------------



Class 12 Informatics Practices 2026 Question Paper with Answers (Full Solution)

  CBSE Class 12 IP 2026 बोर्ड पेपर + Solutions 1. State whether the following statement is True or False: In Pandas Series, the Positional...