Python Notes for B.
Tech 1st Year
1. Introduction to Python
- Python is a high-level, interpreted, and general-purpose programming language.
- Easy syntax, readability, and large community support.
- Applications: Web development, Data Science, AI/ML, Automation, etc.
2. Python Basics
- Variables, Data Types (int, float, str, bool, list, tuple, set, dict)
- Input and Output (input(), print())
- Type casting and Operators (+, -, *, /, %, **, //)
3. Control Statements
- Conditional Statements: if, if-else, if-elif-else
- Looping: for loop, while loop
- Loop control: break, continue, pass
4. Functions in Python
- Defining and calling functions
- Arguments: positional, keyword, default, variable length
- Return statement
- Lambda functions
5. Data Structures
- List: mutable, ordered collection
- Tuple: immutable, ordered collection
- Set: unordered, unique elements
- Dictionary: key-value pairs
6. Strings in Python
- String operations: concatenation, slicing, formatting
- String methods: lower(), upper(), strip(), replace(), split(), join()
7. File Handling
- Opening a file: open()
- Reading/Writing: read(), readline(), write()
- Closing a file: close()
- With statement for automatic handling
8. Object-Oriented Programming (OOP)
- Class and Object
- Constructor (__init__)
- Methods and Attributes
- Inheritance and Polymorphism
9. Exception Handling
- try, except, finally
- raise keyword
- Handling multiple exceptions
10. Libraries in Python
- math, random, datetime
- numpy, pandas (intro)
- matplotlib (intro for visualization)