LinkedIn Insight BSc.-Programming with Python-II-Mumbai-November 2017 - Grad Plus

BSc.-Programming with Python-II-Mumbai-November 2017

MUMBAI UNIVERSITY

Subject: Programming with Python-II

Semester: 2

[Total Time: 2¼ Hours]
[Total Marks:75]
N.B: Please check whether you have got the right question paper.
     1. All questions are compulsory.
     2. Figures to the right indicate marks.
     3. Illustrations, in-depth answers and diagrams will be appreciated.
     4. Mixing of sub-questions is not allowed.
__________________________________________________________________________________________________________________________________________________

Q. 1) A) Attempt All (Each of 5 Marks) (15M)

1) How do you get the current position within the file?
(a) file seek()            (b) file.tell()             (c) file position()             (d) file.current()

2) Which of the following is not a valid mode to open a file.
(a) rb                       
(b) w                        (c)  r+                           (d) w+

3) This widget option is used to size the canvas in the X dimension.
(a) width                   (b) height                 (c) length                     (d) border

4) The purpose of a _____________   widget is to display a set of lines of text.
(a) Entry                    (b) RadioButton        (c) CheckBox                (d) ListBox.

5) To create a socket we must use the __________ function.
(a) socket.socket()     (b) soket.serversocket   (c) socket.accept()    (d) socket.connect()

 

(b) Fill in the blanks.

1) ______________ clause is used when the try block raise an exception.

2) GUI stands for ________________.

3) The ___________________ widget is used to display or enter a single line text.

4) ________________ is protocol which handles sending and routing email between email server.

5) While sending the data through URL with HTTP, this is often done by using ___________ request.

 

C) Short Answers

1) Explain Socket.connect()

2) What Is ‘rb’in file handling?

3) Explain Mysqldb .connect().

4) What is exception?

5) Explain text widget

 

Q. 2) Attempt the following. (Any THREE) (Each of 5Marks) (15M)

a) What is file handling? And Explain its different file mode.

b) Explain different techniques for reading files such as Read and Readlines.

c) Explain how to create a directory, how to change a directory and how to remove a directory in python.

d) What is the use of iterator? Explain with example.

e) Explain different types of exception? How do we handle exception in python? 

f) What is regular expression? Explain with example,

 

Q. 3) Attempt the following: (Any THREE) (Each of 5 Marks) (15M)

a) Explain Gulin python and state its advantages and disadvantages.

b) What is pack layout? Give suitable example.

c) Write a note on canvas object in python GUL

d) Write a short notes on event and binding

e) With the help of proper example explain listbox widget in tkinter.

f) Write a python program to create a gul which will accept name of user in entry box and display a message Hello and user name on the click of button

 

Q. 4) Attempt the following. (Any THREE) (Each of Marks) (15M)

a) What is mysql connector? How to access the mysql connector module in python?

b) Explain commit. How it affects on transaction. Explain with the help of proper example?

c) With the help of proper example explains the difference between fetchone and fetchall in mysql-python connectivity.

d) Write a note on exception handling in database connectivity in Python.

e) Explain Socket module with an example.

f) What is URL? How can we read URL in python?

 

Q. 5) Attempt the following (Any THREE) (Each of SMarks) (15M)

a) Why there is a need of else and finally cause in exception handling? Explain.

b) Write a python program to read the content of file.

c) Differentiate in checkbox and radiobutton.

d) Write a python program to create a database ‘dbemp’, Insert record in table’emp’ with following attribute emp_ld number, emp_name string, emp_sal number.

e) Write a python program where server will send Hello message to client.

__________________________________________________________________________________________________________________________________________________

Scroll to Top