Python Programming (BCC-402) - Summary & Important Questions
Unit 1: Basics of Python
- Introduction to Python, features, and applications
- Python IDEs: IDLE, Jupyter Notebook, PyCharm
- Data types, variables, operators
- Input/output functions, type casting
- Important Question: Explain different data types in Python with examples.
- Important Question: Write a Python program to check if a number is even or odd.
Unit 2: Control Flow and Loops
- Conditional statements: if, if-else, nested if-else
- Loops: for, while, nested loops
- Loop control: break, continue, pass
- Important Question: Write a Python program to print the Fibonacci series using a while loop.
- Important Question: Explain the use of break and continue with examples.
Unit 3: Functions and Strings
- Defining and calling functions
- Function arguments: default, keyword, variable-length
- String operations: slicing, methods, immutability
- Important Question: Write a Python function to calculate factorial of a number.
- Important Question: Explain string slicing and common string methods in Python.
Unit 4: Lists, Tuples, and Dictionaries
- List operations and methods
- Tuples and their properties
- Dictionaries: creation, access, methods
- Important Question: Difference between list and tuple with examples.
- Important Question: Write a program to count frequency of elements using dictionary.
Unit 5: File Handling and Exception Handling
- Opening and closing files, read/write operations
- File modes, with statement
- Exceptions: try, except, finally, raise
- Important Question: Write a Python program to read a file and count lines and words.
- Important Question: Explain exception handling with an example.