FinalXICS_PracticalsList2024(40 prac)
FinalXICS_PracticalsList2024(40 prac)
S NO. AIM
1. WAP (Write a Program) to Print Name- Horizontally, Vertically, Diagonally, Hindi.
2. Print I-Card:
i) Without using variables
ii) With using variables.
3. Working with Arithmetic Operators.
4. WAP to generate Result Sheet.
5. WAP to accept your name and a number N. Print your name N times.
6. i) WAP to calculate Area and Perimeter of a Circle.
ii)WAP to calculate Area and Perimeter of a Rectangle.
7. WAP to accept two numbers from the user and swap them:
i) Using third variable
ii) Without using third variable.
8. Write a Python program to calculate the amount payable if money has been lent on simple interest.
Principal or money lent = P, Rate = R% per annum and Time = T years. Then Simple Interest (SI)
= (P x R x T)/ 100. Amount payable = Principal + SI.
(P, R and T are given as input to the program)
9. Write a program that asks the user to enter one's name and age. Print out a message addressed to
the user that tells the user the year in which he/she will turn 100 years old.
10. Write a program to calculate in how many days a work will be completed by three persons A, B
and C together. A, B, C take x days, y days and z days respectively to do the job alone. The
formula to calculate the number of days if they work together is xyz/(xy + yz + xz) days where x,
y, and z are given as input to the program.
11. WAP to check eligibility to vote.
12. WAP to check whether a number is even or odd.
13. WAP to input a number (0-9) and print it in words.(using if elif)
14. WAP to accept three numbers and arrange them in ascending order.
15. WAP to accept marks of a student and display the grade.
Grade should be calculated as per the following criteria:
Marks range Grade
90 – 100 A
75 – 89.9 B
60 – 74.5 C
50 – 59.5 D
49 or less E
16. Electricity Bill Calculator
WAP to calculate Electric Bill charges according to charges. Following are the charges:
17. WAP to accept a number from the user and generate the following series:
1. Natural numbers
2. Even numbers
3. Odd numbers
4. Reverse Counting
18. WAP to calculate Factorial of a number.
21. Write a program to input the value of x and n and print the sum of the following series:
23. Input a number and check if the number is a prime or composite number
24. Compute the greatest common divisor and least common multiple of two integers.
25. Count and display the number of vowels, consonants, uppercase, lowercase characters in string.
26. Input a string and determine whether it is a palindrome or not; convert the case of characters in a
string.
a) Input an element from the user that has to be inserted in the list (dynamic list).
b) Also input the position at which it is to be inserted. Insert the element at the desired
position in the list.
28. 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.
29. 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.
a) The program should ask for the position of the element to be deleted from the list. Delete the
element at the desired position in the list.
b) The program should ask for the value of the element to be deleted from the list. Delete the
element of this value from the list.
31. 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. [Hint: You may use the
function split()]
32. Write a program to input names of n students and store them in a tuple. Also, input a name from
the user and find if this student is present in the tuple or not.
33. Write a Python program to create a dictionary from a string. Note: Track the count of the letters
from the string. Sample string : 'w3resource' Expected output : {'3': 1, 's': 1, 'r': 2, 'u': 1, 'w': 1, 'c': 1,
'e': 2, 'o': 1}
34. Write a program to input your friends’ names and their Phone Numbers and store them in the
dictionary as the key-value pair. Perform the following operations on the dictionary:
a) Display the name and phone number of all your friends
b) Add a new key-value pair in this dictionary and display the modified dictionary
c) Delete a particular friend from the dictionary
d) Modify the phone number of an existing friend
e) Check if a friend is present in the dictionary or not
f) Display the dictionary in sorted order of names
35. WAP to create menu driven program:
1. String
2. Tuple
3. List
4. Dictionary
5. Exit
36. WAP to create a menu driven program:
Working with Modules
1. Math
2. Random
3. Statistics
4. exit
37. WAP to create a list L3 from two given lists L1 and L2 such that the elements of L1 are placed at
even index and elements of list L2 are placed at odd index of L3. For example : if L1= [1,2,3,4,5]
and L2 =[7,8,9,10,11] then L3 should be [1,7,2,8,3,9,4,10,5,11]
38. Input a list of N values from the user. Display the list. Now display the element of a list
twice if it is a number and display the element terminated with “*” if it is not a number.
39. Write python code to read a number and determine the no. of digits in that no. Also write the
reversed no. of that number. The program should keep on running till user wants to run.
Example : If Input is 7895.
OUTPUT:
Original No.:7895
No of digits:4
Reversed no is 5987
40. Sumit phones old and inventory shows and wants to maintain the record of his inventory in the
form of a dictionary in Python The dictionary should Store item name as the key and its quantity as
the value. Write code snippet for the following
i) create the dictionary with name inventory containing following items and quantity
Item Quantity
Pencil 50
Notebook 100
Clip 700
ii) To display number of items in the above dictionary
iii) Add a new item eraser with quantity 200
iv) to increase the quantity off notebook by 50
v) to display the item with maximum quantity