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

Python Programming Exam Questions

This document outlines a preparatory examination for Python programming, consisting of multiple choice questions and descriptive questions. It covers various topics including conditional statements, functions, data structures, classes, and exception handling. The exam is structured into two parts: Part A with 10 multiple choice questions and Part B requiring answers to any five full questions.

Uploaded by

ataulmustafa4172
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)
8 views2 pages

Python Programming Exam Questions

This document outlines a preparatory examination for Python programming, consisting of multiple choice questions and descriptive questions. It covers various topics including conditional statements, functions, data structures, classes, and exception handling. The exam is structured into two parts: Part A with 10 multiple choice questions and Part B requiring answers to any five full questions.

Uploaded by

ataulmustafa4172
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

PREPRATORY EXAMINATION-3

SUBJECT: PYTHON PROGRAMMING

MARKS: 50 marks

TIME: 2 hours

PART-A
Multiple choice questions [1x10=10 Marks]
1. Which statement is used for decision making in Python?
a. for b. while
c. if d. print
2. What is the main purpose of a function in Python?
a. To store data b. To perform a specific task
c. To display output d. To stop execution
3. Which data structure allows only unique elements?

a. List b. Set
c. Dictionary d. Tuple
4. What is an instance of a class called?
a. Method b. Object
c. Function d. Module
5. Which function is automatically called when an object is created?
a. stop() b. start()
c. init() d. create()
6. How can you read one line at a time from a file?
a. [Link]() b. [Link]()
c. [Link]() d. [Link]()
7. Which keyword is used to handle exceptions in Python?
a. handle b. try
c. except d. Both b and c
8. What type of error can be caught using exception handling?
a. Syntax errors b. Runtime errors
c. Indentation errors d. Compilation errors
9. Which statement is used to include a module in Python?
a. include b. add
c. import d. module
10. Which of the following statements is true about the try–except block?
a. Try block can exist without except block b. Except block can exist without try block
c. Both try and except must always be used together d. Python automatically adds try when an
error occurs.

PART-B
ANSWER ANY FIVE FULL QUESTIONS

1. a) Explain any two conditional statements in Python with an example to illustrate how
they work together. (4 marks)
b) List and explain any two types of operators.(4 marks) — [Unit – 1]
2. a) What is a function? Explain the advantages of using functions in Python.[4marks]
b)Write a Python program using a function to find factorial of a number.[4marks]
3. a) Explain parameters and return values in Python functions with examples.. [5 Marks]
b)Define
a. Local Variables
b. Global Variables(3 marks)— [Unit – 2]
4. a) Write short notes on Lists, Tuples, Sets and Dictionaries with examples. [4 Marks]
b) Explain Stack and Queue operations with examples.. [4 Marks]
5. a) Define class and object with example.[4 Marks]
b) Explain concept of inheritance in Python with example. [4 Marks]
6. a) Define file handling & briefly explain different file modes available in Python[6
Marks]
b) Write two differences between text files and binary files. [2 Marks]
7. Explain the concept of exception handling in Python with syntax and examples .[8marks]

8. a) Explain different ways to import a module in Python.. [4 Marks]

b) What is a package in Python? How is it created?[4Marks]

You might also like