PRACTICAL FILE OF COMPUTER SCIENCE
PYTHON PROGRAMS–
PRACTICAL FILE
Created By: Goransh Birgotra
Class: 11thA2
Subject: CS (083)
Teacher Incharge : Radhika
Handa
1| Page
PRACTICAL FILE OF COMPUTER SCIENCE
Index
S. No. NAME OF THE PROGRAM PAGE No.
1. Write a program to count and display the number of vowels, consonants, uppercase, 3
lowercase characters in string.
2. Input a string and determine whether it is a palindrome or not. 4
3. Write a Python program to find the frequency of each character in a string. 5
4. Write a Python program to create a list of numbers and: 6-7
Find the largest and smallest element
Calculate the sum of elements
5. Input a list of numbers and swap elements at the even location with the elements at the odd 8
location.
.
6. Write a Python program to create a tuple of numbers and find: 9-10
Maximum value
Minimum value
7. Write a program to check whether an element exists in a tuple. 11
8. Write a program to count the occurrence of an element in a tuple. 12
9. Write a Python program to create a dictionary storing: 13
Roll Number as key
Student Name as value
Display the dictionary.
10. Create a dictionary with the roll number, name and marks of n students in a class and display 14
the names of students who have scored marks above 75.
11. Write a program to reverse a list without using the reverse() function. 15
2| Page
PRACTICAL FILE OF COMPUTER SCIENCE
[Link] to count and display the number of
vowels, consonants, uppercase, lowercase
characters in string.
Source Code:
Output:
3| Page
PRACTICAL FILE OF COMPUTER SCIENCE
2. Program to input a string and determine whether
it is a palindrome or not.
Source Code:
Output:
4| Page
PRACTICAL FILE OF COMPUTER SCIENCE
3. Program to find the frequency of each character
in a string.
Source Code:
Output:
5| Page
PRACTICAL FILE OF COMPUTER SCIENCE
4. Program to create a list of numbers and:
Source Code:
Find the largest and smallest element
Output:
6| Page
PRACTICAL FILE OF COMPUTER SCIENCE
Source Code:
Calculate the sum of elements
Output:
7| Page
PRACTICAL FILE OF COMPUTER SCIENCE
5. Program that Input a list of numbers and
swap elements at the even location with the
elements at the odd location.
Source Code:
Output:
8| Page
PRACTICAL FILE OF COMPUTER SCIENCE
6. Python program to create a tuple of numbers and find:
Source Code:
Maximum Value
Output:
9| Page
PRACTICAL FILE OF COMPUTER SCIENCE
Source Code:
Minimum Value
Output:
10| Page
PRACTICAL FILE OF COMPUTER SCIENCE
7. Program to check whether an element
exists in a tuple.
Source Code:
Output:
11| Page
PRACTICAL FILE OF COMPUTER SCIENCE
[Link] to count the occurrence of an element in a tuple.
Source Code:
Output:
12| Page
PRACTICALFILEOFARTIFICIALINTELLIGENCE
9. Program to create a dictionary storing:
Roll Number as key
Student Name as value
Source Code:
Output:
13| Page
PRACTICALFILEOFARTIFICIALINTELLIGENCE
10. 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 scored marks
above 75.
Source Code:
Output:
14| Page
PRACTICALFILEOFARTIFICIALINTELLIGENCE
11. Program to reverse a list without using the
reverse () function.
Source Code:
Output:
15| Page