M.C.
A PRACTICAL END SEMESTER EXAMINATIONS, JANUARY 2022
First Semester
MC4112 - PYTHON PROGRAMMING LABORATORY
(Regulations 2021)
Time : 3 Hours Answer any one Question Max. Marks 100
Aim/Principle/Apparatus Tabulation/ Calculation Viva-Voce Record Total
required/Procedure Circuit/Program/ & Results
Drawing
10+10 20+30 10 10 10 100
1. (i) Write a Python program to compute the square root of a given number.
(ii) Write a Python program to check the given number is palindrome or not.
2. (i) Write a Python program to read and print values of variables of different data types.
(ii) Write a Python program to find the sum of squares of even numbers.
3. (i) Write a python program to calculate area of a triangle using Heron’s formula.
(ii) Write a python program to sort n numbers using Quick sort.
4. (i) Write a python program to print the following pattern.
Page 1 of 4
(ii) Write a python program to calculate the distance between two points using function.
5. (i) Write a python program to print the factorial of a number using for loop.
(ii) write a python program to perform Binary search.
6. (i) write a python program to determine whether the character entered is vowel or not.
(ii) write a python program to test whether a number entered by the user is positive, negative or
equal to zero.
7. (i) Write a python program to convert Fahrenheit into Celsius.
(ii) Write a python program to sort n numbers using insertion sort.
8. (i) Write a python program to demonstrate the slice operations used to access the element of
the list.
(ii) write a python program to perform Linear search.
9. (i) write a python program to display the highest and lowest value in the tuple.
(ii) Write a python program to copy the content from one file to another.
10. (i) Write a Python program to compute the absolute value of a given number.
(ii) Write a Python program to check the given number is Armstrong or not.
11. (i) Write a python program to interchange two values using tuple assignment.
(ii) write a python program to read n names and sort names in alphabetic order.
12. (i) Write a python program to sort keys of a dictionary.
(ii) Write a Python program to find the most frequent words in a text read from a file.
Page 2 of 4
13. (i) Write a python program to find the GCD of two numbers.
(ii) Write a python program to calculate sum and average of n numbers.
14. (i) Write a Python program to find whether a given year is leap year or not.
(ii) Write a python program to sort n numbers using Merge sort.
15. (i) Write a Python program to print the numbers from 50 to 1 using while loop.
(ii) Write a Python program to convert a binary number into decimal number.
16. (i) Write a python program to calculate pow(x,n).
(ii) Write a python program to implement class concept.
17. (i) Write a python program to calculate the area of a triangle using function.
(ii) write a python program to validate the mark range using exception handling.
(Range between 1-100).
18. (i) Write a NumPy program to test whether any of the elements of a given array is non-zero
(ii) Write a python program to sort n numbers using Selection sort.
19. (i) write a python program to print 20 horizontal asterisks(*)
(ii) Write a Python program to find the most frequent words in a text read from a file
20. (i) Write a python program to count the number consonants in the string.
(ii) Implementing programs using written modules and Python Standard Libraries
Page 3 of 4
(pandas, numpy.)
Page 4 of 4