Class X Practical File 2025-26
Class X Practical File 2025-26
Q1. Write a python program to input two numbers and print their sum,
difference, product and quotient.
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
print("The sum of numbers is :" , num1 + num2)
print("The difference of numbers is :" , num1 - num2)
print("The product of numbers is :" , num1 * num2)
print("The division of numbers is :" , num1 / num2)
print("Thank you")
Q2. Write a python program to calculate area of a rectangle after taking lenght
and breadth as input from the user.
length = float(input("Enter length of the rectangle:"))
breadth = float(input("Enter breadth of the rectangle:"))
area = 2 * (length + breadth)
print("The length of the rectangle is:", length, "cms")
print("The breadth of the rectangle is:", breadth, "cms")
print("The area of the rectangle is: ", area, "cm sq.")
Enter a number: 55
Q5. Write a python program to determine whether the given number is even or
odd.
number = int(input("Enter a number of your choice:"))
if number % 2 == 0:
print("Since the number is divisible by 2, it is even")
else:
print("Since the number is not divisible by 2, it is odd")
7 x 1 = 7
7 x 2 = 14
7 x 3 = 21
7 x 4 = 28
7 x 5 = 35
7 x 6 = 42
7 x 7 = 49
7 x 8 = 56
7 x 9 = 63
7 x 10 = 70
Q7. Write a python program to print the first n natural numbers. n will be
given by the user.
n = int(input("Enter a positive number upto which you want to count: "))
print("The first", n, "natural numbers are:", end= " ")
for i in range( 1 , n+1, 1):
print(i, end = " ")
Q9. Write a python program to print first n odd numbers. n will be given by
user.
n = int(input("Enter the number of odd numbers you want to print:"))
odd = 1
print("First n odd numbers are:", end = " ")
for i in range(n):
print(odd, end= " ")
odd += 2
Q10. Write a python program to print the names of friends from a list.
friends = ["Neha", "Arti", "Soham", "Sakshi", "Rudra", "Radhika", "Yasmeen"]
for names in friends:
print(names)
Neha
Arti
Soham
Sakshi
Rudra
Radhika
Yasmeen
Q11. Write the python program to combine the lists given below into a list
named Class10
boys = ["Rakshit", "Daksh", "Abhay"]
girls = ["Riya", "Pratha", "Ashna"]
boys = ["Rakshit", "Daksh", "Abhay"]
girls = ["Riya", "Pratha", "Ashna"]
class10 = boys + girls
print("Boys + girls of class X are:", class10)
1 , 4 , 7 , 10 , 13 , 16 , 19 , 22 , 25 , 28 , 31 , 34 , 37 , 40 ,
Q14. Write python code to print the line chart for sales in 4 quarters.
Quarters = ["Q1", "Q2", "Q3", "Q4"]
Sales = [ 24000, 30000, 34000, 33000]
import matplotlib.pyplot as plt
quarters = ["Q1", "Q2", "Q3", "Q4"]
sales = [24000, 30000, 34000, 33000]
plt.plot(quarters, sales , color = "Red")
plt.show()
Q15. Consider the 2 lists- Section and contribution.
Create a bar graph with section on x-axis and contribution on y-axis.
section = ["A", "B", "C", "D"]
contribution = [2000, 2300, 1900, 2100]
import matplotlib.pyplot as plt
section = ["A", "B", "C","D"]
contribution = [2000, 2300, 1900, 2100]
plt.bar(section, contribution)
plt.show()