0% found this document useful (0 votes)
7 views

Oop Using Python

Uploaded by

avni38802
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Oop Using Python

Uploaded by

avni38802
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

SIKKIM MANIPAL UNIVERSITY

IlISEMESTER B.TECH(AI& DS)DEGREE EXAMINATION


OBJECTORIENTED PROG. USING PYTHON
AD 1303 |CGPA -(21)(3CR)I
Duration: 3hrs Max marks: 100

Note: Answer all questions.


Any missing or misprinted data may be assumed suitably. 8
Q.No Sub Marks
Description
Q.No. allotted
1 (a) Formulate arithmetic operations (Addition, Subtraction, Multiplication, and [7]
Division) on integers. Input the two integer values and operatOr 1or
performing arithmetic operation through keyboard.
(b) Construct apython program to find whether the given number is odd or even. [5]
(c) Write a python program to print the factorial of a given number. [5]
(d) What recursive function? 3]
2 (a) Express multilevel inheritane with
v an example. [7]
(b) Construct a program to demonstrate parameterized constructor. [5]
(c) Make a comparison between object-oriented and procedure-oriented [S]
programming languages.
(d) Explain your understand ing about command line arguments. [3)
3 (a) Explain life cycle of a thread with proper diagram. [7]
(b) Develop a simple program which illustrates exceptions handling. [5]
(C) Demonstrate inheritance in python with example. [5]
(d) Difference between built in exceptions and handling exception. [3]
4 (a) Develop a program to display all the lines in a file python.txt" which have [7]
the word to" in it.
(b) What are the different operations we can perform on file?
(c) Create a program to demonstrate try, finally block with syntax.
(d) [5]
In how many different ways multithreading can be achieve in python?
[3]
5 (a) Develop a program to write the string Welcome! Please have a seat" in the
file wel.txt, that has not yet been created.
(b) Write a short note on packaging python projects. [5]
(c) Create a Python GUI program to create three single line text-box to accept a
value from the user using tkinter module.
(d) What is an Exception?
[3]

Page 1 of 1
SIKKIM MANIIPAL UNIVERSITY
EXAMINATION
IISEMESTER B.TECIH(AI& DS) DEGREE
USING PYTIION
OBJECT ORIENTED PROG.
AD 1303 |CGPA-(21) (3CR)]
Max nrks: 100
Duration: 3hrs
13 JAN 2023
Note: Answer all questions. suitably.
Any missing or misprinteddata may beassumed
Description Marks
Q.No Sub allotted
Q.No. using
1 (a) Write a pythonprogram for swapping of two numbers with and without |71
temporary variable.
Write apython program to Iind the given year is leap or not. [5]
(b) Explain the break and continuc statement with the help of "for loop" witlh an [5]
(c)
example.
Differentiate global and local variables. |3|
(d)
List different types of inheritance and explain cach onc with suitable examples.
2 (a) Write a program 1o demonstrate parameterizedconstructor in the basc class
(b)
and derived class.

(c) Define class? How to create a class and its object in python. |I44]
(d) Describe user-defined function in pytlhon. |3]

3 (a) Demonstrate about the GUI programming in python with proper program 17]
example.
(b) What is the predefined function uscd to find length of a string? Illustrate with [2+3|
a suitable program.
(c) Differentiate between method overloading and method overriding.
(d) What do you understand by errors and exception? [3]
4 (a) Express multilevel inheritance with an example. [7]
(b) Write a program to read .txt file using for loop". [5]
(c) Differentiate between file modes rt and wt with respect to python. [5]
(d) What is recursive function? (31
(a) Creat a program to execute thrcad synchronization mechanism in python.
(b) Execute a python GUI program to create two buttons: exit and hello using
tkinter module.
(c) Write five benefits of multithreading in python. [S]
(d) Write a short note on PyPI. [3]

1/1
SIKKIM MANIPAL UNIVERSITY
SEMESTER B.TECH(AL& DSs) DEGREE EXAMINATION
OBJECT ORIENTED PROG. USING PYT'ION
Duration: 3hrs AD 1303 |CGPA -(21) (3CR)]
Max marks: 100
Note: Answer all
Any missing or questions.
misprinted data may be assumed suitably.
Q.No Sub
Q.No. Description Marks
(a) allotted
What are the major features and
1o find applications
(b) Create recursive function of python?
(c) factorial of a number.
Develop a single program to show publicprivate
(d) What is protected access modilier.
2
Indentation? Explain with example. |1+2|
(a)
(b)
Explain inheritance in python with
(c)
Write about class constructor ( init example.
0)and
17]
(d) Differentiate betwcen method overloading sclf-variable.
and method overriding.
Describe polymorphism.
3 |3]
(a) List out different string
three. operations. Writc an example program ior any |l+6]
(b) Make a comparison between
default constructor and
(c)
constructor. paramctcrised
Explain thread life cycle using propcr
(d) What is root window? diagram. [5]
4 |3]
(a) Create a user defined exception with an
(b) Create a python program to read a given example
CSV file
program.
(c) Develop a python program to read first 'n' lines ofasa afile.list.
(d) Why Exception Handling is required?
5 [3]
(a) Construct a program to execute thread synchronization mechanism in
python.
(b) Write a python GUI program to add a
tkinter module. button in your application using
(c) Write a python program to create a table and
table. insert some records in that [5]
(d) Write a short note on python package index
(PyPI). [3]

Fage 1 of 1

You might also like