Roll No. Total No.
of Pages : 02
Total No. of Questions : 18
B.Tech (CSE) (Sem.–5)
PROGRAMMING IN PYTHON
Subject Code : BTCS-510-18
M.Code : 78324
Time : 3 Hrs. Max. Marks : 60
INST RUCT IONS T O CANDIDAT ES :
1. SECTION-A is COMPULSORY cons is ting of TEN questions carrying TWO marks
each.
2. SECTION-B c ontains FIVE questions c arrying FIVE marks eac h and s tudents
have to atte mpt any FOUR ques tions.
3. SECTION-C contains THREE questions carrying TEN marks e ach and s tudents
have to atte mpt any TWO questions.
m
SECTION-A
o
Write briefly :
r . c
e
1) Define pickling.
2) Python Interpreter.
a p o m
3)
r p
Intermediate mode and script mode.
r . c
4) b
Lists in Python.
pe
5) Define exceptions.
p a
6) Define Recursion.
b r
7) String lower function.
8) Define HTTP.
9) Special symbols in Python.
10) Global Interpreter lock.
1|M -78324 (S2)-329
SECTION-B
11) Differentiate between function and module in Python.
12) Test whether a given year is leap year or not.
13) Write code to print Fibonacci series.
14) Write a note on Object Relational Managers (ORMs).
15) Differentiate between simple and advanced web clients.
SECTION-C
16) Describe the syntax and semantics of any two loop structures provided by Python.
m
17) Write a note on Python Database Application Programmer’s lnterface (DB-API).
o
. c
18) Differentiate between thread module, threading module and related module.
r
p e m
p a c o
r r .
b p e
p a
b r
2|M -78324 (S2)-329
Roll No. Total No. of Pages : 02
Total No. of Questions : 09
B.Tech. CSE (Internet of Things and Cyber Security including Block
Chain Technology) (Sem.–5)
PROGRAMMING IN PYTHON
Subject Code : BTAIML-501-20
M.Code : 92370
Date of Examination : 24-12-22
Time : 3 Hrs. Max. Marks : 60
INSTRUCTIONS TO CANDIDATES :
1. SECTION-A is COMPULSORY consisting of TEN questions carrying T WO marks
each.
2. SECTION-B contains FIVE questions carrying FIVE marks each and students
have to attempt any FOUR questions.
3. SECTION-C contains T HREE questions carrying T EN marks each and students
have to attempt any T WO questions.
o
SECTION-Am
1. Write briefly : .r c
p e m
a. What are identifiers? List the rules to name an identifier in Python.
a o
p .r c
b. Write a python program to calculate simple interest and compound interest.
b r
c. Write down the steps of installing Python.
e
a p
d. Explain the utility of ‘Break’ statement with the help of an example.
r p
e. What are user-defined functions? Give an example to illustrate their use in Python
program.
b
f. Differentiate between pass by value and pass by reference with the help of examples.
g. What are packages in Python? Discuss their utility.
h. With the help of suitable examples explain different ways in which you can write data
in a file in Python program.
i. How is a generator function different from normal functions?
j. What are class members? How are they accessed?
1 | M-92370 (S2)-1306
SECTION-B
2. Describe the significant features of Python. Write a short note on data types in Python
giving suitable examples of each.
3. Write a short note on conditional branching statements supported by Python. Write a
Python program to demonstrate the use of nested if structure.
4. Discuss the significance of modules in Python. Explain the process of module definition
and module import with the help of examples.
5. Write a brief note on file management in Python. Write a Python program that reads text
from a file and writes it into another file but in the reverse order.
6. What are the applications of the Collections module? Write about the following members
of the Collections module: namedtuple(), deque, Counter and UserDict and illustrate their
usage.
o m
.r c
SECTION-C
7. Write a detailed note on dictionaries. Write a program that repeatedly asks the user to
p e
enter product names and prices. Store all of these in a dictionary whose keys are the
m
product names and whose values are the prices. When the user is done entering products
a o
and prices, allow them to repeatedly enter a product name and print the corresponding
p
price or a message if the product is not in the dictionary.
r .r c
8.
b e
Write a detailed note on object-oriented features available in Python. How are classes
p
created and instantiated in Python? Explain with the help of detailed example.
9.
p a
Differentiate between error and exception. What happens when an exception is raised in a
b r
Python program? Explain any three built-in Python exceptions with relevant examples.
Write a python program that has multiple except blocks.
2 | M-92370 (S2)-1306
Roll No. Total No. of Pages : 02
Total No. of Questions : 09
B.Tech. (CE) (Sem.–5)
PROGRAMMING IN PYTHON
Subject Code : BTCS-510-18
M.Code : 91023
Date of Examination : 24-12-2022
Time : 3 Hrs. Max. Marks : 60
INSTRUCTIONS TO CANDIDATES :
1. SECTION-A is COMPULSORY consisting of TEN questions carrying T WO marks
each.
2. SECTION-B contains FIVE questions carrying FIVE marks each and students
have to attempt any FOUR questions.
3. SECTION-C contains T HREE questions carrying T EN marks each and students
have to attempt any T WO questions.
m
SECTION-A
o
1.
.r c
Define the following used in Python Programming :
a) Python objects
p e m
a o
p .r c
b) Lists
c) Exceptions
b r e
d) Packages
a p
e) Regular expressions
r p
f) Thread module
b
g) Web surfing
h) Web servers
i) DB-API
j) CGI.
1 | M-91023 (S2)-1938
SECTION-B
2. List any five built-in functions used in Python. Give suitable examples.
3. What is the significance of Namespaces in Python programming.
4. Write a python program to calculate the length of a string without using library functibns.
5. Write the steps to create simple web clients in Python.
6. How are object relational mappers useful?
SECTION-C
7. How multi-threaded programming is done in Python? Give an illustration.
8.
m
Define lists in Python. Write a python program to find the intersection of two lists.
o
.r c
9. Discuss the commonly used Tkinter widgets used with python programming.
p e m
a o
r p .r c
b p e
p a
b r
2 | M-91023 (S2)-1938
Roll No. Total No. of Pages : 02
Total No. of Questions : 09
B.Tech. (CSE) (Sem.–5)
PROGRAMMING IN PYTHON
Subject Code : BTCS-510-18
M.Code : 78324
Date of Examination : 27-01-2023
Time : 3 Hrs. Max. Marks : 60
INSTRUCTIONS TO CANDIDATES :
1. SECTION-A is COMPULSORY consisting of TEN questions carrying T WO marks
each.
2. SECTION-B contains FIVE questions carrying FIVE marks each and students
have to attempt any FOUR questions.
3. SECTION-C contains T HREE questions carrying T EN marks each and students
have to attempt any T WO questions.
m
SECTION-A
o
1. Write briefly :
.r c
p e
a) Discuss briefly about dir() and help() functions.
m
a o
p .r c
b) Differentiate between an error and an exception.
b r
c) What is persistent storage?
e
d) Explain briefly about modulus.
a p
r p
e) Write a short note on global interpreter lock.
f) What are regular expressions?
b
g) Explain briefly about web surfing.
h) Describe the relationship between child and parent windows.
i) Write a short note on application programmer’s interface (DB-API).
j) Write a SQL command to create a table with three fields of different types.
1 | M-78324 (S2)-1287
SECTION-B
2. Differentiate between Lists and Tuples with the help of an example.
3. What are command-line arguments? Explain clearly the difference between ‘argc’ and
‘argv’ arguments.
4. What is pattern-matching? Describe two ways to accomplish pattern-matching.
5. Write a short note on Tkinter, Pmw and Tix GUI highlighting the difference among
them.
6. What are adapters in databases? Discuss various factors to be considered while
choosing an adapter.
SECTION-C
7.
o m
What is Common Gateway Interface (CGI)? Explain in detail about the working of CGI
.r c
with the help of an example.
8. What are hash tables and how do they relate to dictionaries? Also explain how are the
p e
elements inserted, updated and removed from dictionaries.
m
a o
.r c
9. Describe the process of exception detection and handling in detail with the help of an
r p
example. What role does assertion play in exception handling?
b p e
p a
b r
2 | M-78324 (S2)-1287