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

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

MUMBAI UNIVERSITY

Subject: Programming with Python-II

Semester: 2

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

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

A) Multiple Choice Questions (5M)

1 Which function is used to close the file?
a) close()                                         b) stop()
c) closefile()                                    d) end

2 The ________ method is used to display current working directory.
a) mkdir()                                        b) stop()
c) getcwd()                                      d) rmdir()

3 To arranging or controlling different python tkinter widget on the screen we use_____.
a) TK()                                              b) tkinter
c) layout manager                           d) none of these

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

5 This widget option is used to size the canvas in the X diemention
a) width                                            b) height
c) length                                           d) border

 

B) Fill in the blanks. (5M)

1 Python exceptions are caught by the _________ keyword.

2 __________ mode is used to open file to read in binary format.

3 We can execute the sql queries from python program using ________method

4 SMTP stands for ____________________________.

5 While sending the data through URL with HTTP, this is often done by Using ____________ request.

 

C) Short Answers. (5M)

1 Why we use rowcount() method?

2 Explain Socket.bind()

3 What is ‘r+’ in file handling?

4 When do we use fetchone() function. in database.

5 Explain Label widget.

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

a) Explain in detail python file functions for reading, writing, positioning, and seeking within file contents?

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 the followings:
1) Try 2) Except 3) Finally

f) What is regular expression? Explain with example.

 

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

a) Explain GUI in python and state its advantages and disadvantages.

b) What is grid layout? Give suitable example.

c) What are the different types of messagebox available in message widget of tkinter module?

d) With the help of proper example explain radiobutton widget in tkinter module.

e) Write a python GUI that contains three Radio buttons for colors “Red”, “Green”, and “Blue”. Display selected color on a label.

f) Write a python Canvas program to draw Circle, Polygon, and Arc with effects.

 

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

a) What is mysql connector? How to access and connect with database using MySQL connector? Give and Explain steps with example.

b) Write a python program to insert a value in database table emp with following attribute emp_id number, emp_name string, emp_sal number.

c) How to execute different types of statements on a database table? Explain with examples.

d) Differentiate between socket. connect() and socket.bind().

e) What is cursor? Explain it with example.

f)Explain URL with example.

 

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

a) How to apply font on tkinter widgets? Explain with examples.

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

c) Write a python program to write the data into the file.

d) Explain in brief following exceptions:
1) Exception
2) ZeroDivisionError
3) ValueError
4) Nameerror

e) Write a python program to send email.
__________________________________________________________________________________________________________________________________________________

Scroll to Top