0% found this document useful (0 votes)
9 views1 page

Practical File Questions 2024-25

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 1

COMPUTER SCIENCE PRACTICAL COPY QUESTIONS 2024-25

CONDITIONAL AND LOOPING CONSTRUCT


1. Write a program to print the sum of series :
X1/1 + X2/2 + X3/3+……………….+Xn/n
2. Write a program to generate the following patterns using nested loops.
A
AB
ABC
ABCD
ABCDE
3. Write a program to generate the following patterns using nested loops.
1
12
123
1234
12345
4.Write a program to input a character and check whether the given character is an alphabet, digit or
special character.
5. Write a program to find the sum of digits of an integer number input by the user.
6. Write a program to find the reverse of digits of an integer number input by the the user.
STRING MANIPULATION
7.Write a program to input a string and convert all the uppercase letters to lowercase and all the
lowercase letters to uppercase letters.(For example: pASsiON3* will convert to PasSIon3*)
8. Write a program to input a string and check if a string is a palindrome or not.
9. Write a program to input a string from the user and create a new string in reverse order.
LIST MANIPULATION
10. Write a program to read a list of elements. Modify this list so that it does not contain any duplicate
elements, i.e., all elements occurring multiple times in the list should appear only once.
11.Write a program to input a list of numbers and swap elements at the even locations with the
elements of odd location.
12. Write a Python program to create a list of integers and display only the prime numbers from that list.
13.Write a program to input a list of numbers and search for a number in a list. If a number is found,
then print its location otherwise print an appropriate message if the number is not present in the list.
14. Write a program to read a list of n integers (positive as well as negative). Create two new lists, one
having all positive numbers and the other having all negative numbers from the given list. Print all
three lists.
TUPLES
15. Write a program to input n numbers from the user. Store these numbers in a tuple. Print the
maximum and minimum number from this tuple.(use built in function)
16. Write a program to read email IDs of n number of students and store them in a tuple.Create two
new tuples one to store only the usernames from the email IDs and second to store domain names
from the email ids.Print all three tuples at the end of the program.(Use split function)
DICTIONARY
17.Write a program to input n employee names and their phone numbers to store it in a dictionary as
key:value pair. Input a name to search and display its phone no if found in dictionary otherwise display
an error message.

You might also like