0% found this document useful (0 votes)
151 views3 pages

CST283 Python For Machine Learning, December 2022

This document appears to be an exam for a Python for Machine Learning course, consisting of multiple choice and written answer questions across 5 modules: 1) The first part of the exam (Part A) contains 10 multiple choice questions worth 3 marks each on topics like Python variables, operators, functions, and data structures. 2) The second part (Part B) contains 4 full questions worth 14 marks each, with questions on logical operators, software development process, operators, and functions. 3) The exam covers topics such as Python syntax, variables, data structures, functions, classes, files, and modules. Students are required to write Python code in their answers.

Uploaded by

Aslam Mohammed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
151 views3 pages

CST283 Python For Machine Learning, December 2022

This document appears to be an exam for a Python for Machine Learning course, consisting of multiple choice and written answer questions across 5 modules: 1) The first part of the exam (Part A) contains 10 multiple choice questions worth 3 marks each on topics like Python variables, operators, functions, and data structures. 2) The second part (Part B) contains 4 full questions worth 14 marks each, with questions on logical operators, software development process, operators, and functions. 3) The exam covers topics such as Python syntax, variables, data structures, functions, classes, files, and modules. Students are required to write Python code in their answers.

Uploaded by

Aslam Mohammed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

M 0800csT283122102

Reg No.: Name:


APJ ABDUL KALAM TECHNOLOGICAL UNIVE ol
7
t4
Third Semester B.Tech (Minor) Degree Examination December 2022 (2

Course Code: CST283

Course Name: Python for Machine Learning


Max. Marks: 100 Duration:3 Hours

PART A

Answer all questions. Each question conies 3 marks Marks

I Write the rules to be followed for naming any variables in python. (3)

2 lllustrate the importance of indentation in python. (3)

3 illustrate the concept of local and global variables in python with example. (3)

4. Writd a program that uses lambda function to multiply two numbers. (3)

5 What is a tuple? Explain the mutability of a tuple with suitable example. (3)

6 Explain List Slicing with suitable examples. (3)

7 Define class, object and methods with an example (3)

8 What is the difference between multiple and multilevel inheritance? Give an (3)
example. .-i

Write the output of the following code: (3)


..; l

import numpy as np

array 1
=rp.array
(Il0,l2,l 4,1 6,18,20,22))

print(anayl [:5:2])

print(arrayl [-4:])

l0 Write a program to plot a range from I to 30 with step value 4. Use following (3)
algebraic expression to show data y :5*x*2.

Page lof3
0800csT283122102

PART B
t
Answer any onefull questionfrom each module. Each question carries 14 marks

Module I

l l a) examples.
Write the various logical and bitwise operator with (6)

b) Explain the software development process with a neat figure. (g)

12 a) Describe the arithmetic, identity and membership operators in Python with (7)

an examPle.

b) What is the difference between type conversion and type coercion? Give
suitable example. Also, write a program to convert temperature in degree (7)
* 9= Celsius))
Fahrenheit to Celsius. ((farenheit- 32) 5I

Module 2

13 a) Explain the use of return statement in function. Write a Python program (7)

using function to find the sum of first 'n' even numbers and return the
.
result to main Program.
b) Write python Program to reverse a number and also find the sum of digits (7)

of the number (prompt the user for input).


14 a) Write Python program to count the total number of vowels, consonants (6)
and blanks in a string.

b) What are default arguments and named arguments in function? Write a


menu driven Python program to input a number and implement the (8)
, flfillowing operations. Use separate functions to implement each operation.
8) check whether the number is odd or even
ii) check whether the numbg;is positive, negative or zero '

Module 3

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

and sorted0 in dictionary? Give examples.

Page 2of3
0800csr283t22r02

16 a) Illustrate the following Set methods with an example. (6)


8) intersection 0 ii) union 0 iii) issubset 0 iv) difference0 v) update0 vi)
discard0
b) Write a Python program to find the largest and second largest ofn numbers (8)
in a list. Assume n>=3 and all the numbers are distinct.
Module 4

17 a) Describe the use of try and except block in python with example. Write a (6)
program to handle a divide by zero exception. Also add a finally block.

b) Create a class student with name, roll number, marks of 3 subjects and

total marks as attributes. Read_dataQ,display_dataQ and compute totalQ (8)


should be the three methods. Write a python program to create 2 objects
of the class, read, display and calculate the total marks.
l8 a) examples.
Explain operator overloading and polymorphism with (8)
b) Consider a Rectangle Class and create two Rectangle Objects. Write
(6)
Python program to check whether the area of the first rectangle is greater
than second by overloading > operator.
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) WhatarethecharacteristicsofCsVfiles?Explainthemethodsforreading (6)


and writing the CSV files.
t b; What'is usoof os and sys module? Write any 3 methods of os and sys (8)
\-"

module.
..;

Page 3of3

You might also like