BPLCK105B / BPLCK205B – Introduction to Python Programming Solved Model Question Paper – Set 1
BPLCK105B / BPLCK205B – Introduction to Python Programming Solved Model Question Paper with Answers – Set 1
Module – 1
Q.01
a. What is an arithmetic expression? What is the output of this statement?
‘hello world’ + 100 + ’how are you’. Explain the reason if the statement produces an error.
b. Discuss various methods of importing modules in Python programs. Which method is best? Explain.
c. What is the lambda function? Explain with an example of addition of two numbers.
OR
Q.02
a. What is a flow control statement? Discuss if and if else statements with flow chart.
b. Write a python program to add n numbers accepted from the user.
c. How can you prevent a python program from crashing? Discuss different ways to avoid crashing.
Module – 2
Q.03
a. Discuss list and dictionary data structure with example for each.
b. Write a python program to accept n numbers and store them in a list. Then print the list without ODD numbers in it.
c. For a=['hello', 'how', [1,2,3], [[10,20,30]]]
what is the output of the following statements:
(i) print(a[ : : ])
(ii) print(a[-3][0])
(iii) print(a[2][ : -1])
(iv) print(a[0][ : : -1])
OR
Q.04
a. Write a python program to read dictionary data and delete any given key entry in the dictionary.
b. Explain different clipboard functions in python used in wiki markup.
c. Using string slicing operation write python program to reverse each word in a given string (e.g., input: “hello how are you”, output: “olleh woh era uoy”)
Module – 3
Q.05
a. Discuss different paths of file system.
b. Explain how to read specific lines from a file? Illustrate with python program.
c. What is logging? How this would be used to debug the python program?
OR
Q.06
a. What is the use of ZIP? How to create a ZIP folder? Explain.
b. Write an algorithm to implement multi clipboard functionality.
c. Discuss how lists would be written in the file and read from the file.
Module – 4
Q.07
a. Define the terms with example:
(i) class
(ii) objects
(iii) instance variables
b. Create a Time class with hour, min and sec as attributes. Demonstrate how two Time objects would be added.
c. Discuss __str__()
and __init__()
methods used in class definition.
OR
Q.08
a. What is Encapsulation? Discuss with an example in which access specifiers are used in class definition.
b. What is a class diagram? Create empty class and corresponding class diagram for following statements:
(i) class A derives from class B and Class C
(ii) Class D derived from Class A defined in statement (i)
c. Discuss polymorphism and demonstrate with a python program.
Module -5
Q.09
a. Write python program to read cell 2C from sheet 2 of workbook.
b. Explain how PDF pages would be created in a PDF document with example.
c. What is JSON? Discuss with example. Compare it with dictionary.
OR
Q.10
a. Compare and contrast Excel and CSV files.
b. Demonstrate how a class would be converted into JSON object with an example.
c. Explain how a page from different PDFs files would be merged into a new PDF file.