Python Programming
UNIT I – Python Basics
Explain features of Python in detail.
What is Python Interpreter? Explain compilation vs interpretation.
Explain dynamic typing with example.
Explain strongly typed features.
Explain data types in Python with examples.
Explain variables and its rules?
Explain operators in Python (Arithmetic, Relational, Logical,
Assignment).
Explain conditional statements with flowchart and example.
Write syntax and example of nested if-else.
Explain while loop with example.
Explain for loop using range().
Difference between while and for loop.
Explain break, continue, and pass with examples.
Write a program to check prime number.
Write a program for Armstrong number.
Write a program to print Fibonacci series.
Write a program to reverse a number.
Explain Boolean values and logical operators.
What are membership operators? Explain with example.
Difference between compiled and interpreted languages.
UNIT II – Data Structures
Explain List with properties and example.
Explain all list methods with example.
What is list slicing? Explain with example.
What is list comprehension? Write program.
Explain shallow copy vs deep copy.
Explain Tuple and its properties.
Difference between List and Tuple.
Explain tuple unpacking with example.
Explain Dictionary with example.
Explain dictionary methods: keys(), values(), items().
Write a program to count character frequency using dictionary.
What are nested dictionaries?
Explain Strings in Python.
Explain string methods: lower(), upper(), strip(), split(), join().
Write a program to check palindrome string.
Explain Set in Python.
Explain set operations: union, intersection, difference.
What is symmetric difference?
Difference between List, Tuple, Set and Dictionary.
Write short notes on mutable and immutable objects.
UNIT III – Functions & File Handling
What is function? Explain syntax.
Difference between built-in and user-defined functions.
Explain function arguments (positional, default, keyword).
Difference between local and global variables.
What is recursion? Write factorial program using recursion.
Explain lambda function with syntax.
Explain map(), filter(), reduce() with example.
Write program using lambda and map().
Write program using filter().
Explain file handling concept.
Explain file modes: r, w, a, r+, w+, a+.
Explain read(), readline(), readlines().
Explain write() and writelines().
What is seek() and tell()?
Write program to copy content from one file to another.
Write program to count words in file.
Explain exception in file handling.
Explain with open statement.
What is global keyword?
Difference between append and write mode.
UNIT IV – Classes, Modules & Exception Handling
Define Class and Object.
Explain constructor and destructor.
Explain init() method.
What is encapsulation? Explain with example.
What is inheritance? Types of inheritance.
Explain single inheritance with program.
Explain multiple inheritance with example.
Explain diamond problem.
What is polymorphism?
What are modules?
Difference between import and from import.
Explain built-in modules (sys, random, time).
What are packages?
Role of [Link] file.
What is exception handling?
Explain try-except-finally.
What is raise statement?
Explain hierarchy of exceptions.
Write program for ZeroDivisionError handling.
Difference between error and exception.
UNIT V – Database & GUI Programming
What is database connectivity in Python?
Steps to connect Python with MySQL/SQLite.
Explain cursor object.
Explain SQL commands: CREATE, INSERT, UPDATE, DELETE.
Write program to insert record into database.
Write program to display records.
What is commit() and rollback()?
Explain execute() method.
What is GUI?
Explain Tkinter module.
Explain Label, Button, Entry widgets.
Explain layout managers (pack, grid, place).
What is event-driven programming?
Write program to create simple login form.
Explain frames in Tkinter.
How to handle button click event?
What are dialogs?
a. Difference between console and GUI application.
b. Write program combining database + GUI.
c. Advantages of GUI programming.