NEW GOVERMENT POLYTECHNIC,PATNA -13
SUBJECT- PYTHON
SEMESTER-4nd
ASSIGNMENT QUESTIONS1.
[Link] & Looping Statements
Explain different types of conditional statements in Python (if, if-else, if-elif-
else).
2. String and List Operations
(a) Explain string operations: concatenation, repetition, slicing with
examples.
(b) Write a Python program to:
Count the frequency of each element in a list
Perform linear search on a list
3. Functions in Python
(a) What are user-defined functions? Explain arguments and parameters with
examples.
(b) Write a Python program using a function to calculate factorial of a
number.
(c) Explain the difference between global and local variables.
4. Object Oriented Programming (OOP)
(a) Define class and object with example.
(b) Explain inheritance and its types (single, multiple, multilevel,
hierarchical).
(c) Write a Python program demonstrating method overriding.
5. Exception & File Handling
(a) What is exception handling? Explain try-except-else-finally with
example.