Previous Year Question Paper Dec 2022 Python For Machine Learning - CST 283 - KTU Minor

 APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY
Third Semester B.Tech (Minor) Degree Examination December 2022 (2021 admn.)

Course Code: CST283

Course Name: Python for Machine Learning
Max. Marks: 100
Duration: 3 Hours
PART A
Answer all questions. Each question carries 3 marks


1.Write the rules to be followed for naming any variables in python.
2.Illustrate the importance of indentation in python.
3.Illustrate the concept of local and global variables in python with example.
4.Write a program that uses lambda function to multiply two numbers.
5.What is a tuple? Explain the mutability of a tuple with suitable example.
6.Explain List Slicing with suitable examples.
7.Define class, object and methods with an example
8.What is the difference between multiple and multilevel inheritance? Give an example.
9.Write the output of the following code:
import numpy as np
array1=np.array([10,12,14,16,18,20,22])
print(array1[1:5:2])
print(array1[-4:])
10.Write a program to plot a range from 1 to 30 with step value 4. Use following algebraic expression to show data y = 5*x+2.

 PART B

Answer any one full question from each module. Each question carries 14 marks

Module 1

11a) Write the various logical and bitwise operator with examples.(6)
b) Explain the software development process with a neat figure.(8)

12a) Describe the arithmetic, identity and membership operators in Python with an example.(7)
b) What is the difference between type conversion and type coercion? Give suitable example. Also, write a program to convert temperature in degree Fahrenheit to Celsius.

 ((farenheit-32) *5/9= Celsius))(7)

Module 2

13a) Explain the use of return statement in function. Write a Python program using function to find the sum of first ‘n’ even numbers and return the result to main program.(7)
b) Write Python Program to reverse a number and also find the sum of digits of the number (prompt the user for input).(7)

14a) Write Python program to count the total number of vowels, consonants and blanks in a string.(6)
b) What are default arguments and named arguments in function? Write a menu driven Python program to input a number and implement the following operations. Use separate functions to implement each operation.(8)
i)check whether the number is odd or even
ii) check whether the number is positive, negative or zero

Module 3

15a) What is the difference between append and extend function of python lists? Write a python code to input n numbers and calculate sum of cubes of each number and store it in a list.(7)
b) Define dictionary with an example. What is the use of all(), any(), cmp() and sorted() in dictionary? Give examples.(7)

16a) Illustrate the following Set methods with an example.
i) intersection () ii) union () iii) issubset () iv) difference() v) update() vi) discard()
b) Write a Python program to find the largest and second largest of n numbers in a list. Assume n>=3 and all the numbers are distinct.

Module 4

17a) Describe the use of try and except block in python with example. Write a program to handle a divide by zero exception. Also add a finally block.(6)
b) Create a class student with name, roll number, marks of 3 subjects and total marks as attributes. Read_data() ,display_data() and compute_total() should be the three methods. Write a python program to create 2 objects of the class, read, display and calculate the total marks.(8) 

18a) Explain operator overloading and polymorphism with examples.(8)
b) Consider a Rectangle Class and create two Rectangle Objects. Write Python program to check whether the area of the first rectangle is greater than second by overloading > operator.(6)

Module 5

19.a) Explain Data Analysis and Visualization in Python with suitable example.(8)
b) What are binary files? Write the different file opening modes.(6)
 

20 a) What are the characteristics of CSV files? Explain the methods for reading and writing the CSV files. (6)

b) What is use of os and sys module? Write any 3 methods of os and sys module.(8)

*****

 

Comments

Popular posts from this blog

Python For Machine Learning - CST 283 - KTU Minor Notes- Dr Binu V P

46.Classes and Objects in Python- Accessors and mutators

KTU Python for machine learning Sample Question Paper and Answer Key Dec 2020