0% found this document useful (0 votes)
7 views

Class_X_Python_Practical_File

The document outlines holiday homework for Class X, consisting of various programming tasks in Python. Each task includes a brief description, example input, and expected output, covering topics such as simple interest calculation, leap year check, prime number identification, and list manipulation. The homework aims to enhance students' practical coding skills through hands-on exercises.

Uploaded by

Virat Joshi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Class_X_Python_Practical_File

The document outlines holiday homework for Class X, consisting of various programming tasks in Python. Each task includes a brief description, example input, and expected output, covering topics such as simple interest calculation, leap year check, prime number identification, and list manipulation. The homework aims to enhance students' practical coding skills through hands-on exercises.

Uploaded by

Virat Joshi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

HOLIDAY HOMEWORK 2025-26

CLASS X - PRACTICAL FILE


1. Simple Interest
p = float(input("Enter Principal: "))
r = float(input("Enter Rate: "))
t = float(input("Enter Time: "))
si = (p * r * t) / 100
print("Simple Interest:", si)

Input: 2000, 5, 2
Output: 200.0

2. Multiple of 5
n = int(input("Enter a number: "))
if n % 5 == 0:
print("Multiple of 5")
else:
print("Not a multiple of 5")

Input: 15
Output: Multiple of 5

3. Leap Year Check


year = int(input("Enter a year: "))
if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
print("Leap Year")
else:
print("Not a Leap Year")

Input: 2024
Output: Leap Year

4. Prime or Composite
n = int(input("Enter a number: "))
if n < 2:
print("Neither Prime nor Composite")
else:
for i in range(2, n):
if n % i == 0:
print("Composite")
break
else:
print("Prime")

Input: 17
Output: Prime
5. Grade Based on Marks
marks = int(input("Enter marks: "))
if 90 <= marks <= 100:
print("Grade: A+")
elif 80 <= marks < 90:
print("Grade: A")
elif 70 <= marks < 80:
print("Grade: B+")
elif 60 <= marks < 70:
print("Grade: B")
elif 50 <= marks < 60:
print("Grade: C")
else:
print("Fail")

Input: 85
Output: Grade: A

6. List Initialization & Reversal


lst = ['a','b','c','d','e','f','g','h','i','j']
print("Original List:", lst)
lst.reverse()
print("Reversed List:", lst)

Output: ['j', 'i', 'h', 'g', 'f', 'e', 'd', 'c', 'b', 'a']

7. Extend and Sort List


L = [12, 14, 16, 18]
L.extend([13, 15, 19])
L.sort()
print("Final Sorted List:", L)

Output: [12, 13, 14, 15, 16, 18, 19]

8. Factorial of a Number
n = int(input("Enter a number: "))
fact = 1
for i in range(1, n + 1):
fact *= i
print("Factorial:", fact)

Input: 5
Output: 120

9. Table of a Number
n = int(input("Enter a number: "))
for i in range(1, 11):
print(f"{n} x {i} = {n * i}")
Input: 4
Output: Table from 4x1 to 4x10

10. Tuple Sorting Descending


t = (10, 25, 15, 5)
sorted_tuple = tuple(sorted(t, reverse=True))
print("Descending Tuple:", sorted_tuple)

Output: (25, 15, 10, 5)

11. Dictionary of Students


students = {}
for i in range(5):
roll = int(input("Enter roll no: "))
name = input("Enter name: ")
students[roll] = name
print("Student Dictionary:", students)

Example: {1: 'Ram', 2: 'Shyam', 3: 'Aman', 4: 'Reena', 5: 'Tina'}

12. First 20 Fibonacci Numbers


a, b = 0, 1
for i in range(20):
print(a, end=" ")
a, b = b, a + b

Output: 0 1 1 2 3 5 ... 4181

13. First 10 Even Numbers


for i in range(1, 11):
print(i * 2, end=" ")

Output: 2 4 6 8 10 12 14 16 18 20

14. Sum of First 10 Natural Numbers


s = 0
for i in range(1, 11):
s += i
print("Sum of first 10 natural numbers:", s)

Output: 55

15. Count Elements in a List


lst = [10, 20, 30, 40, 50]
count = 0
for i in lst:
count += 1
print("Number of elements:", count)
Output: 5

You might also like