.
Printed Page:-04 Subject Code:- ACSE0202/ACSEH0202
Roll. No:
NOIDA INSTITUTE OF ENGINEERING AND TECHNOLOGY, GREATER NOIDA
(An Autonomous Institute Affiliated to AKTU, Lucknow)
B.Tech
SEM: II - THEORY EXAMINATION - (2023 - 2024)
Subject: Problem Solving using Advanced Python
Time: 3 Hours Max. Marks: 100
General Instructions:
IMP: Verify that you have received the question paper with the correct course, code, branch etc.
1. This Question paper comprises of three Sections -A, B, & C. It consists of Multiple Choice
Questions (MCQ’s) & Subjective type questions.
2. Maximum marks for each question are indicated on right -hand side of each question.
3. Illustrate your answers with neat sketches wherever necessary.
2 4
4. Assume suitable data if necessary.
5. Preferably, write the answers in sequential order.
2 0
6. No sheet should be left blank. Any written material after a blank sheet will not be
evaluated/checked.
SECTION A
C H 20
1. Attempt all parts:-
1-a.
A R
Which of the following creates a new type? (CO1) 1
(a) class
(b) object M
O P
(c) attribute
(d) method
1-b.
C
__________ methods passed to the calling class.
(a) class method
(CO1) 1
(b) staticmethod
(c) Both a and b
(d) None of the above method
1-c. What will be the output of the following Python code? (CO2) 1
class A:
def__init__(self,x=3):
self._x= x
class B(A):
.
Page 1 of 5
.
def__init__(self):
super().__init__(5)
def display(self):
print(self._x)
def main():
obj=B()
obj.display()
main()
(a) 5
(b) Error, class member x has two values
(c) 3
(d) Error, protected class member can’t be accessed in a subclass
1-d. What will be the output of the following Python code?
2
(CO2)
4 1
import sys
def function():
2 0
pass
class MyObject(object):
C H
def __init__(self):
A R
pass
M
o = MyObject()
print(type(""))
O P
C(a) <class 'int'>
(b) <class 'str'>
(c) <class 'type'>
(d) <class 'None'>
1-e. What will be the output of the following Python code? (CO3) 1
from functools import reduce
m=reduce(lambda x: x-3 in range(4, 10))
print(list(m))
(a) [1, 2, 3, 4, 5, 6, 7]
.
Page 2 of 5
.
(b) No output
(c) [1, 2, 3, 4, 5, 6]
(d) Error
1-f. The output of the following codes are the same. (CO3) 1
[x**2 for x in range(10)]
list(map((lambda x:x**2), range(10)))
(a) TRUE
(b) FALSE
1-g. How we import a tkinter in python program ? (CO4) 1
(a) import tkinter
(b) import tkinter as t
(c) from tkinter import *
2 4
1-h.
(d) All of the above
How we install tkinter in system ? (CO4)
(a) pip install python 2 0 1
(b) tkinter install
(c) pip install tkinter
C H
1-i.
(d) tkinter pip install
A R
Which of the following is not valid to import the numpy module? (CO5) 1
(a) import numpy as np
(b) import numpy as n M
O P
(c) import numpy as p
(d) None of the mention
1-j.
C
scipy.linalg always compiled with? (CO5)
(a) BLAS/LAPACK support
1
(b) BLAS/Linalg support
(c) Linalg/LAPACK support
(d) None of the mention
2. Attempt all parts:-
2.a. State the difference between User-Defined Class and Built-in Class. (CO1) 2
2.b. How to identify a derived class? (CO2) 2
2.c. Differentiate between co-routines and subroutine. (CO3) 2
.
Page 3 of 5
.
2.d. How to set a widget's size in Tkinter? (CO4) 2
2.e. How can we create copy of series in Pandas? (CO5) 2
SECTION B 30
3. Answer any five of the following:-
3-a. Write a program to find mean of two numbers belonging to two objects of the 6
same class. (CO1)
3-b. Explain how we can create a empty class. Also create two object of that class 6
and create two instance variable of the class. (CO1)
3-c. Define an abstract class in Python?. Write a python program to calculate the 6
area of circle, square and rectangle using an abstract class named "AREA".
(CO2)
3-d. Elaborate the term "Polymorphism" in Python. Mention different types of 6
Polymorphism in Python. (CO2)
2 4
3.e.
3.f.
example. (CO3)
0
State the difference between Iterators and Generators in Python with an
2
Explain the use of grid. Differentiate among place(), pack() and grid() functions
6
3.g.
in tkinter. (CO4)
C H
How to create 3D Array or ND Array explain with example? (CO5) 6
4. Answer any one of the following:-
A R
SECTION C 50
4-a.
methods (CO1) M
Write a program to demonstrate the use of __getitem__() and __setitem__() 10
4-b.
O P
Compare with the help of an example Instance method, Class method and
Static Method in python. (CO2)
10
5-a.
5-b.
C
5. Answer any one of the following:-
Explain 5 most useful introspection functions in python. (CO2)
Define Object-Oriented Programming. State the different types of Inheritance
10
10
with the help of an example for each type of inheritance. (CO2)
6. Answer any one of the following:-
6-a. Elaborate the term "Decorators" in Python. Also, explain chain decorator with 10
the help of a python program. (CO3)
6-b. What is lambda function. Explain how lambda functions used in filter() with an 10
example. (CO3)
7. Answer any one of the following:-
.
Page 4 of 5
.
7-a. Write a program to create a form. The form should contain the following labels: 10
1. NAME 2. ROLL NO. 3. BRANCH 4. YEAR AND SEM 5. CONTACT 6. SUBMIT
BUTTON. (CO4)
7-b. Write a program to display two labels with different background. Write a 10
program to print a colored text on a colored background of GUI window. (CO4)
8. Answer any one of the following:-
8-a. How to add an Index, row, or column to a Pandas DataFrame? (CO5) 10
8-b. What Is Time Series In pandas? How to convert String to date? (CO5) 10
2 4
2 0
C H
A R
M
O P
C
.
Page 5 of 5