0% found this document useful (0 votes)
71 views2 pages

Expected Question Paper

The document is an expected question paper for a Python programming course, outlining various instructions for the examination. It includes multiple sections with questions covering topics such as data structures, file handling, classes, and exception handling. Students are required to attempt a specified number of questions from each section, with emphasis on practical programming tasks and theoretical explanations.

Uploaded by

arqamqazi549
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views2 pages

Expected Question Paper

The document is an expected question paper for a Python programming course, outlining various instructions for the examination. It includes multiple sections with questions covering topics such as data structures, file handling, classes, and exception handling. Students are required to attempt a specified number of questions from each section, with emphasis on practical programming tasks and theoretical explanations.

Uploaded by

arqamqazi549
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

22616 - Python Programming (Expected Question Paper) - Salman

Instructions - (1) All Questions are Compulsory.

(2) Answer each next main Question on a new page.

(3) Illustrate your answers with neat sketches wherever necessary.

(4) Figures to the right indicate full marks.

(5) Assume suitable data, if necessary.

(6) Mobile Phone, Pager and any other Electronic Communication devices are not permissible in Examination Hall.

Q.1 Attempt any FIVE of the following: (10 Marks)

a) Compare list and tuple.

b) Write use of read() and readline() functions.

c) Explain the role of indentation in Python.

d) Write the syntax to create a dictionary in Python.

e) What are identity operators?

f) Define class and object with example.

g) Write any two differences between module and package.

Q.2 Attempt any THREE of the following: (12 Marks)

a) Write a Python program to print the following pattern:

10

101

1010

b) Create a class Student with roll no and name. Accept and display it.

c) Write a Python program to check if a number is a palindrome or not.

d) Explain any four built-in list functions with example.

Q.3 Attempt any THREE of the following: (12 Marks)

a) Describe any four file modes in Python.

b) Write a program using module to calculate factorial of a number.

c) Explain any four membership and identity operators with examples.

d) Write a Python program to perform the following operations on a set:

- Create

- Add

- Access

Page 1
22616 - Python Programming (Expected Question Paper) - Salman

- Remove

Q.4 Attempt any THREE of the following: (12 Marks)

a) Differentiate between readline() and readlines() with example.

b) Explain try-except block with a program.

c) Write a program to read content of one file and write to another file.

d) Explain NumPy and Pandas packages with example.

e) Explain method overloading and overriding with examples.

Q.5 Attempt any TWO of the following: (12 Marks)

a) Write output for the following:

course = "Python"

print(course[:3])

print(course[3:])

print(course[-1])

print(course[1])

b) Write a program to create a class Diploma, with subclasses CO and IF, each printing their respective

message.

c) Create a user-defined package and show how to import and use it in another Python file.

Q.6 Attempt any TWO of the following: (12 Marks)

a) Write a program to implement multiple inheritance.

b) Write a Python program to create a user-defined exception that checks whether the password is strong or

not.

c) Explain any four set functions with examples.

Page 2

You might also like