List of Programs For Practical Record 2024-25
List of Programs For Practical Record 2024-25
The following is the minimum list of programs that are to be included in your practical record.
This list will be updated as and when new programs are taken in class.
Data Handling
2. Write a program to input 3 numbers and find the smallest number 02/05/2024
3. Write a program to input the 3 sides of a triangle and calculate its 08/05/2024
area using the Heron’s formula.
4. Write a program to input the values of a, b,c and find the roots of a 03/05/2024
quadratic equation
Write a program to calculate the electricity bill with the number of 08/05/2024
units consumed. The program should take care of the following
information: the first 100 units are free, next 200 units it is 0.25/ unit,
the next 300 units it is 0.50/ unit, the next 500 units it is 0.75/ unit
5.
and above that it is 1.00/ unit. In addition you have a rent of 15 and a
VAT of 5% for the total amount.
You should display the bill with all the necessary information.
6. Write a program to input a date (dd, mm, yyyy) and check if the date 13/05/2024
is valid or invalid.
For Loop
10. Write a program to generate all the perfect numbers less than 1000. 16/05/2024
11. Write a program to check if the input number is prime or composite. 17/05/2024
12. Write a program to generate all prime numbers between 2 and 1000. 17/05/224
While Loop
13. Write a program to print the sum of the given digit. 24/05/2024
18. Write a program to generate the Armstrong numbers between 1 and 28/05/2024
1000.
19. Write a program to input the value of x and n and print the sum of the 29/05/2024
following series:
2 3 4 𝑛
1+x+𝑥 +𝑥 .+𝑥 +............𝑥
20. Write a program to input the value of x and n and print the sum of the 29/05/2024
following series:
2 3 4 𝑛
1-x+𝑥 -𝑥 .+𝑥 −............𝑥
21. Write a program to input the value of x and n and print the sum of the 29/05/2024
following series:
2 3 4 𝑛
𝑥 𝑥 𝑥 𝑥
x+ 2
- 3
+ 4
-........... 𝑛
22. Write a program to input the value of x and n and print the sum of the 29/05/2024
following series:
2 3 4 𝑛
𝑥 𝑥 𝑥 𝑥
x+ 2!
- 3!
+ 4!
-........... 𝑛!
String
23. Write a program to input a string and print the following information. 05/06/2024
a) The total number of characters
b) The total number of lowercase characters.
c) The total number of uppercase characters.
d) The total number of digits.
e) The total number of special characters.
24. Write a python program that should perform the following four tasks. 12/06/2024
(1) After getting a word from the user, your program should use a
while(or for) loop to print out each of the letters of the word.
(2)Your program should then use another loop to print out each of
the letters of the same word in reverse order.
(3) make a new variable that is the original word in reverse and print
that variable.
(4) Ask the user for a letter to count. Use another loop to count how
many times that letter appears in the original word
25. Write a program to prompt the user for two strings and check if one 4/06/2024
of the strings is a prefix of another. Print an appropriate message to
inform the user which is the prefix of which or that neither is a prefix.
26. Write a program that prompts a user for their password and then 20/06/2024
determines if the password is valid or not. A password is valid if it
satisfies the following conditions.
a) Minimum 6 characters
b) At least one of the special character ‘#@$’
c) At least one uppercase alphabet.
d) At least one lowercase alphabet.
e) At least one digit.
28 Write a menu driven program to find the area of the following shapes 25/06/2024
1. Rectangle
2. Triangle
3. Circle
4. Cylinder
5. Exit the program
List
29. Write a program that prints the largest even number in the list of
integers. If there is no even number in the input, print ‘No even
numbers’.
30. Write a program that prints the sum of even-indexed elements of list
L, minus the sum of the odd-indexed elements of list L
31. Input a list of strings and concatenate (joined) the list of strings with
a hyphen in between two elements.
32. Write a program to find the median from an input list of numbers.
33. Write a program to find the mode from an input list of numbers.
34. Write a program to find the range from an input list of numbers
35. Write a program to input a list of numbers and create a new list that
stores the cumulative sum of values.
2D List
Random module
40. Write a program to make a biased coin that takes 60 % heads and 01-10-2025
40 % tails. It should then be trailed for 10000 times and print the
probability of getting heads and tails.
42. Write a menu driven program that generates random numbers with 04-10-2024
the following options.
1. To get a one digit random number
2. To get a two digit random number
3. To get a three digit random number
4. To get a four digit random number
5. To exit the menu
Tuples
43. Write a program that inputs a tuple and creates a new tuple that 24/10/2024
contains every third element of the original tuple, starting at index 0.
Don’t use slice notation. Write code using a for loop.
44. Write a program that inputs a tuple having words of a string as its 28/10/2024
elements eg (‘the’, ‘quick’,’brown’,’fox’) and then translates each text
element to Pig Latin.
[English is translated to Pig Latin by taking the first letter of every
word, moving it to the end of the word and adding ‘ay’.] so the output
for the above input is
(‘hetay’,’uickqay’,’rownbay’,’oxfay’)
Dictionary
45. Write a program that stores the month name as a key and the 07/11/2024
number of days as a value in the dictionary and then ask the user for
the month name and display the corresponding days for the month
46. Repeatedly ask the user to enter a team name and how many 07/11/2024
games the team has won and how many they lost. Store this
information in a dictionary where the keys are the team names and
the values are a list of the form [wins, losses].
a)Using the dictionary created above, allow the user to enter a team
name and print out the team’s winning percentage.
b)Using the dictionary, create a list whose entries are the number of
wins of each team.
Number system
47. Write a program to input an integer number and convert the number 27/11/2024
to binary.
48. Write a program to input an integer and convert the number to its 27/11/2024
octal.
49. Write a program to input an integer number and convert the number 28/11/2024
to hexadecimal.
50. Write a program to input a hexadecimal value and convert the 28/11/2024
number to decimal value.
*************************************************************************