1.
Getting Started with Python
1. Who created Python? In which year was it released?
2. Why is Python considered a beginner-friendly language?
3. List any five features of Python.
4. Mention at least five applications of Python.
5. What is the file extension of a Python source file?
6. Write two examples of single-line and multi-line comments.
7. What are multiline statements? Give two examples.
8. Steps to install Python on Windows.
9. What does “Add Python to PATH” do?
10.How do you install the Python extension in VS Code?
11.What is a virtual environment? Why is it needed?
12.Write commands for:
o Creating a virtual environment
o Activating it (Windows & Linux/Mac)
o Deactivating it
13.What is the purpose of pip? Write an example command.
2. Python Fundamentals
1. What are keywords? Give ten examples.
2. Define identifiers. Write rules for naming identifiers.
3. What is a variable? Explain with examples.
4. What is dynamic typing in Python?
5. Explain memory allocation and garbage collection in Python.
6. Difference between input() and print().
7. Why does input() always return a string?
8. Write examples showing:
o int(), float(), str() conversions
9. Explain Python data types:
o int, float, complex, str, bool, None
10.What is implicit type conversion? Give example.
11.What is explicit type conversion? Give example.
12.What does id() return?
3. Operators and Expressions
1. What is an operator? List all types of operators in Python.
2. Write examples of all arithmetic operators.
3. What are assignment operators? Give five examples.
4. Explain comparison operators with examples.
5. Explain logical operators: and, or, not.
6. What are bitwise operators? Write binary explanation for:
a = 10, b = 6, compute a & b, a | b, a ^ b.
7. Explain left shift and right shift with examples.
8. Difference between == and is.
9. Difference between in and not in.
10.Write example program comparing identity and equality.
4. Control Structures
1. What is the purpose of control structures?
2. Write syntax of:
o if
o if…else
o if…elif…else
3. Why is indentation important in Python?
4. Define nested if with an example.
5. What is range()? Write all variations.
6. What is a for loop? Give three examples.
7. What is a while loop? Give two examples.
8. Explain nested loops with an example.
9. What is the purpose of else with loops?
10.Define break, continue, and pass with examples.
5. Functions in Python
1. What is a function? Why are functions useful?
2. Difference between built-in and user-defined functions.
3. Syntax of function definition.
4. What is a return statement? Can a function return multiple values?
5. What is a docstring? Give an example.
6. Types of function arguments:
o Positional o Default
o Keyword o *args
o **kwargs
7. Difference between print() and return.
8. What is variable scope? Explain local, global, enclosing.
9. What is LEGB Rule?
10.Purpose of global and nonlocal keywords.
11.What is a lambda function? Write three examples.
12.Define recursion. What are:
o Base case
o Recursive case
13.Write recursive programs for factorial & Fibonacci.
6. Data Structures in Depth
Strings
1. What is a string? How to create one?
2. Explain string indexing and slicing with examples.
3. What are escape characters? Give examples.
4. Why are strings immutable?
5. Difference between +, +=, join().
6. Write uses of:
o upper(), lower(), capitalize(), split(), find(), replace()
7. What are f-strings?
Lists
1. What is a list? Why is it called mutable?
2. Explain list indexing and slicing.
3. Write any ten list methods and examples.
4. What is list comprehension? Give examples.
5. What are nested lists?
6. Difference between append() and insert().
Tuples
1. What is a tuple? How is it different from a list?
2. What is tuple immutability? How to update a tuple?
3. Explain tuple methods count() and index().
Sets
1. What is a set? What are its properties?
2. Write examples of set operations:
o union
o intersection
o difference
3. Why are sets unordered?
Dictionaries
1. What is a dictionary? How to create one?
2. Difference between key and value.
3. Write any eight dictionary methods.
4. Write example of iterating through keys and values.
7. Modules in Python
1. What is a module? How to create one?
2. How do you import a module?
3. Difference between import module and from module import function.
4. What is a package? What is [Link]?
5. Explain dir(), help().
8. File Handling
1. What are file modes in Python?
2. Difference between text mode and binary mode.
3. Write syntax for:
o Opening a file
o Reading a file
o Writing a file
o Closing a file
4. What is the difference between read(), readline(), readlines()?
5. What is with statement? Why is it preferred?
6. Program to count lines, words, characters.
9. OOP in Python
1. What is object-oriented programming?
2. Define class and object with examples.
3. What is init()? Why is it used?
4. Difference between instance and class attributes.
5. What are access modifiers?
6. Explain types of methods:
o Instance method
o Class method
o Static method
7. What is inheritance? Types of inheritance in Python.
8. What is polymorphism? Give examples.
9. Define encapsulation and abstraction.
10.Explain super() with example.
10. Exception Handling
1. What is an exception?
2. Difference between syntax error and runtime error.
3. Explain try, except, else, finally.
4. Write program handling multiple exceptions.
5. What is raise keyword?
6. What is custom exception?
11. Functional Programming
1. What is functional programming?
2. Explain map(), filter(), reduce() with examples.
3. What is a lambda function?
4. Difference between normal function and lambda.
12. MySQL & Python Connectivity
1. What is a database? What is DBMS?
2. What is MySQL? Why is it used?
3. Steps to install MySQL.
4. Commands for:
o Connecting to MySQL
o Creating database
o Creating table
o Inserting values
5. What is mysql-connector-python?
6. Write Python program to connect to MySQL.
7. Write program to insert, fetch, update, delete records using Python.