- Introduction
- Installation
- print() function
print(“Hello World”) - string multiplication
print(“Hi” * 10) - Comments
single line #
multiline comments “”” - Concatenation operator +
- Variables
- int
- string
- boolean
- float
- None – unline Java there is no null available in python instead use None
- type() function
- Variable’s id and is Operator
- Operators
- addition +
- subtraction –
- multiplication *
- power of **
- division /
- int division //
- modulus %
- input() function
- type conversion / type casting
- int(’10’)
- str(9)
- float(‘10.5’)
- bool(‘True’)
- String
- string with single quote ‘string’
- string with double quote “string”
- heredoc – string with triple quote ”’ or “””
heredoc_var = ”’
this is line 1
this is line 2
this is line 3
”’
- Formatted String
print(f”2 * 2 = {2 * 2}”)
print(f”Hello {fname} {lname}”) - String Functions
- len(‘string’) – this is general purpose function can be used for string and list also
- ‘string’.upper()
- ‘StrinG’.lower()
- ‘this is string’.capitalize()
- ‘this is string’.title()
- ‘rain in spain’.find(‘spain’)
- ‘replace x with y’.replace(‘x’, ‘y’)
- ‘this is main string which contains substring’.find(‘substring’) – this returns index number if found else return -1
- ‘substring’ in ‘this is main string which contains substring’ – this returns boolean value
- Math functions
- round(7.3)
- abs(-1234)
- math.ceil(7.3)
- math.floor(7.3)
- format decimal point
print(“{:.2f}“.format(7.3333333333333)
- Conditional Statements:
- if
- if…else
- if…elif…else (Ladder if)
- Increment and Decrement
- x += 1
- x -= 1
- Loop
- while
- for
- Control Statements
- Break
- Continue
- Pass
- Functions
- parameter-less function
- parameterized function
- function not returning value
- function returning value
- [List], (Tuple), {Set}, {Dictionary: (Associative Array)}
- Modules
- Exception Handling
- OOPS
- Classes and Objects
- Encapsulation
- Abstraction
- Inheritance
- Static Method
- Method Overriding
- Private and Public data and variables
- Polymorphism
- Regular Expression
- Modules: OS, PyMySQL, MySQLDB, Pickle, NumPy, Pandas, sklearn
- Database Connection
- Multithreading
- Project (POC)
ALGORITHMS
- Linear Search
- Sorting
- KNN
- Recommendation System
DRF
| Day | Topic | Node.js / Express Mapping | Practical |
|---|---|---|---|
| 1 | DRF intro, project setup, app setup, function-based API, @api_view, GET/POST APIs, Postman testing | express() app, routes, req/res, app.get(), app.post() | Build /hi, /users GET + POST |
| 2 | DB connection, MySQL config, models, serializers, CRUD APIs, GET by ID, PUT, DELETE | mysql2 connection pool, query execution, DTO/validation layer, CRUD routes | Build User CRUD API with MySQL |
| 3 | Python decorators, custom auth decorator, role-based decorator, request flow, exception handling | Express middleware, custom middleware, next(), auth middleware, role middleware | Create @jwt_required and @admin_required |
| 4 | JWT login API, protected routes, token validation, refresh token, custom claims, logout strategy | jsonwebtoken, auth middleware, token verification, refresh flow | Build /login, /profile, /refresh, admin-only route |