0% found this document useful (0 votes)
3 views15 pages

Python Programs

This document is a practical file for a Computer Science class, created by Goransh Birgotra for 11thA2. It includes a list of Python programs covering various topics such as string manipulation, list and tuple operations, and dictionary creation. Each program is accompanied by source code and output sections, although the specific code and outputs are not included in the summary.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views15 pages

Python Programs

This document is a practical file for a Computer Science class, created by Goransh Birgotra for 11thA2. It includes a list of Python programs covering various topics such as string manipulation, list and tuple operations, and dictionary creation. Each program is accompanied by source code and output sections, although the specific code and outputs are not included in the summary.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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

You might also like