 In this article, I will discuss Practical File Computer Science Class 11. This practical file is strictly based on the Computer Science syllabi. So let’s discuss the practical file and practical assessment structure of class 11 computer science. So here we go!

Topics Covered

## Practical File Computer Science Class 11

As per the CBSE curriculum, the practical exam will be conducted at the end of academic year. Observe the structure of practical assessment for Computer Science Class 11.

## Syllabus Computer Science Class 11

The syllabus of computer science class 11 has these topics to be assedssed into practical:

1. Paython Fundamentals
2. If Conditions
3. Loops
4. String Manipulations
5. Lists Manipulations
6. Tuples
7. Dictionary
8. Introduction to Pyton Module

So the practical file programs should be prepared from basics, if conditions, loops, list, tuple, dictionary and python modules. As per the above table, you need to prepare any 20 programs from these topics. Just check a list of programs for the same.

## Suggested Programs – Practical File Computer Science Class 11

The list of suggested programs for Practical File Term 2 Computer Science Class 11 are as follows:

1. Input a welcome message and display it.
2. Input two numbers and display the larger / smaller number.
3. Input three numbers and display the largest / smallest number.
4. Generate the patterns using nested loop.
5. Generate the series.
6. Determine whether a number is a perfect number, an armstrong number or a palindrome.
7. Input a number and check if the number is a prime or composite number.
8. Display the terms of a Fibonacci series.
9. Compute the greatest common divisor and least common multiple of two integers.
10. Count and display the number of vowels, consonants, uppercase, lowercase characters in string.
11. Input a string and determine whether it is a palindrome or not; convert the case of characters in a string.
12. Find the largest/smallest number in a list/tuple
13. Input a list of numbers and swap elements at the even location with the elements at the odd location.
14. Input a list/tuple of elements, search for a given element in the list/tuple.
15. Input a list of numbers and find the smallest and largest number from the list.
16. Create a dictionary with the roll number, name and marks of n students in a class and display the names of students who have scored marks above 75.

In my practical file, I have included the above programs. Along with these, I have included more programs from the topics covered in coomputer science class 11. So here we go!

## Practical File Computer Science Class 11

So let’s begin the Practical File Computer Science Class 11 now. I have included the programs as follows:

### 3 Programs from list manipulations

 Write a program to find the largest number in a list.

``````#Variable declaration
n=int(input("Enter the number of elements:"))
l=[]
m=0

#Input from user
for i in range(n):
val=int(input("Enter element:"))
l.append(val)
print("The original list:",l)

#Finding maximum
for i in l:
if i>m:
m=i
print("The lasrgest number is:",m)

``````

Output:

 Write a program to swap elements at the even location with the elements odd location.

``````#Accept the list values
l=eval(input("Enter the list:"))

#printing orioginal list
print("Original List:",l)

#Finding length and determining length for odd location
length=len(l)
if length%2!=0:
length=length-1

#Logic for swapping elements
for i in range(0,length,2):
l[i],l[i+1]=l[i+1],l[i]

#printing elements after swap
print("List after swap:",l)
``````

 Input a list of elements and search a particular element.

``````#Accept the list values
l=eval(input("Enter the list:"))

n=int(input("Enter element to search:"))

#Variable to check whether element found or not
f=0

#printing orioginal list
print("Original List:",l)

#Checking element is present in the list or not
for i in l:
if i==n:
f=1
break
else:
f=0

#Printing the message if element found in the list
if f==1:
print("Element found in the list")
else:
``````

### 2 Programs from Tuples – Practical File Term 2 Computer Science Class 11

 Write a python program to create a tuple and print a square of each element.

``````#Accepting the tuple
t=eval(input("Enter elements for tuple"))

#Converting the tuples into list for manipulation
l=list(t)

#Printing original list
print("The original tuple:",t)

#traversing the list for computation
for i in range(len(l)):
l[i]=l[i]**2

#Converting list back to tuple
t=tuple(l)

#Printing the square of each element
print(t)
``````

 Write a program to accept string into tuple and extract the digits into a new list. Print the extracted numeric list.

``````#Accepting the tuple
t=eval(input("Enter string elements for tuple:"))

#Declaring list object for extracted elements
l=[]

#Logic to extract numbers from the given tuple
for i in t:
if i.isdigit():
l.append(i)

#CONVERTING THE STRIN INTO INTEGER
for i in range(len(l)):
l[i]=int(l[i])

#PRINTING THE FINAL EXTRACTED LIST
print(l)
``````

### 3 Programs from Dictionary – Practical File Term 2 Computer Science Class 11

 Write a program to create a dictionary with the roll number, name and marks of n students in a class and display the names of students who have marks above 75.

``````#Input for Number of stude
n=int(input("How many students?:"))

#Empty Dictionary
stu={}

#Data Input
for i in range(n):
print("Enter details of student:")
rn=int(input("Enter roll number:"))
name=input("Enter Name:")
marks=float(input("Enter Marks:"))
stu[rn]=[name,marks]

#Logic to display detail of students more than 75 marks
for i in stu:
if stu[i]>75:
print("Name:",stu[i],"Marks:",stu[i])

``````

 Write a menu-driven program to perform following operations:

1. Show record
3. Delete a customer
4. Search record
5. Update record
6. Sort record
7. Exit
``````n=int(input("How many customers:"))
cust={}
for i in range(n):
print("Enter details of customer:",i+1)
cname=input("Enter name of customer:")
pn=int(input("Enter Phone number:"))
cust[cname]=pn
c=0
while c!=7:
print('''
1. Show record
3. Delete a customer
4. Search record
5. Update record
6. Sort record
7. Exit
''')
if c==1:
for i in cust:
print(i,":",cust[i])
elif c==2:
print("Enter details of new customer:")
cname=input("Enter name:")
pn=int(input("Enter phone number:"))
cust[cname]=pn
elif c==3:
nm=input("Enter name to be deleted:")
f=cust.pop(nm,-1)
if f!=-1:
print(f, " is deleted successfully.")
else:
elif c==4:
name=input("Enter Customer Name:")
if name in cust:
print(name, " found in the record.")
else:
elif c==5:
cname=input("Enter Customer Name:")
pn=int(input("Enter phone number to modify:"))
cust[cname]=pn
elif c==6:
l=sorted(cust)
for i in l:
print(i,":",cust[i])
elif c==7:
break
``````

 Write a python program to find the highest 2 values in the dictionary.

``````n=int(input("How many students:"))
std={}
for i in range(n):
print("Enter details of customer:",i+1)
sname=input("Enter name of student:")
per=int(input("Enter percentage:"))
std[sname]=per

s=sorted(std.values())
print("Top two values:",s[-1],s[-2])

``````

### Introduction to python modules

 Write a program to choose any 4 customers randomly for lucky winners out of 100 customers.

``````import random
c1=random.randint(1,100)
c2=random.randint(1,100)
c3=random.randint(1,100)
c4=random.randint(1,100)
print("Lucky winners are:",c1,c2,c3,c4)
``````

 Write a menu-driven program to perform these operations by importing string module.

1. Display the ascii letters
2. Display the digits
4. Display Octdigits
5. Display Punctuation
6. Display the first letter of each word into capital by removing spaces
``````import string
ch=0
while ch!=7:
print('''
1. Display the ascii letters
2. Display the digits
4. Display Octaldigits
5. Display Punctuation
6. Display string in title case
7. Exit
''')
if ch==1:
print(string.ascii_letters)
elif ch==2:
print(string.digits)
elif ch==3:
print(string.hexdigits)
elif ch==4:
print(string.octdigits)
elif ch==5:
print(string.punctuation)
elif ch==6:
s=input("Enter sentence:")
print(string.capwords(s))
elif ch==7:
break

``````