Practical Practice
Practical Practice
1. Write the menu driven program to calculate mean ,mode and median for the given data .
[ 3,5,7,9,13,15,18]
2. Write a program to display Fibonacci Series
3. Write a program to calculate the greatest of 4 numbers. Where the numbers are entered by
user
4. Write a program to display the number entered by user is Armstrong or not
5. Write a program to input a string and count the number of vowels and consonants in the
string
6. Write a program to check the string entered by user is in palindrome or not
7. Write a menu-driven program to calculate the sum, average, and product of a list of numbers
entered by the user.
8. Write a program to find the factorial of a number entered by the user.
9. Write a program to calculate the sum of the first N natural numbers where N is provided by
the user.
10. Write a program to display the prime numbers between 1 and 100.
11. Write a program to find the smallest and largest number in a list of numbers entered by the
user.
12. Write a program to calculate the GCD (Greatest Common Divisor) and LCM (Least Common
Multiple) of two numbers entered by the user.
13. Write a program to generate Pascal's Triangle up to the number of rows entered by the user.
14. Write a program to input a string and count the number of words in the string.
15. Write a program to reverse a string entered by the user.
16. Write a program to sort a list of numbers in ascending and descending order.
17. Write a program to calculate the sum of digits of a number entered by the user.
18. Write a program to check whether a number entered by the user is a perfect number or not.
19. Write a program to convert a decimal number entered by the user into binary, octal, and
hexadecimal.
20. Write a program to input two matrices and perform their addition.
21. Write a program to display the multiplication table of a number entered by the user.
22. Write a program to count the frequency of each character in a string entered by the user.
23. Write a program to input two strings and check whether they are anagrams or not.
24. Write a program to check whether a year entered by the user is a leap year or not.
25. Write a program to implement a basic calculator that can add, subtract, multiply, and divide
two numbers entered by the user.
26. Write a program to find the second largest number in a list entered by the user.
27. Write a program to find the square root of a number entered by the user without using the
math library.
28. Write a program to find the sum of all even and odd numbers in a list entered by the user.
29. Write a program to input a sentence and replace all occurrences of a specific word with
another word.
30. Write a program to display the transpose of a matrix entered by the user.
31. Write a program to input a list of numbers and find the difference between the maximum and
minimum numbers.
4. Write a program using OpenCV to resize an image to half of its original dimensions.
5. Write a program to detect edges in an image using the Canny Edge Detection method in
OpenCV.
7. Write a program to load two images using OpenCV and blend them together using a specified
weight ratio.
8. Write a program to draw a rectangle and circle on an image using OpenCV functions.
10. Write a program to flip an image vertically and horizontally using OpenCV.
Matplotlib (Data Visualization)
1. Write a program to create a line chart using the data:
X = [1, 2, 3, 4, 5]
Y = [10, 20, 30, 40, 50]
2. Write a program to create a bar chart using Matplotlib for:
Categories = ["A", "B", "C", "D"]
Values = [5, 10, 15, 20]
3. Write a program to plot a pie chart using Matplotlib for the data: [30, 20, 50].
8. Write a program to display multiple plots (line chart and bar chart) on the same figure using
subplots.
9. Write a program to customize the appearance of a Matplotlib plot by adding titles, labels, and
legends.
10. Write a program to create a box plot using Matplotlib for a list of data points. (Dummy data)