PYTHON
• High level
•Interpreted Language
• Object oriented
• Dynamically typed
• Multi-Paradigm
• Open Source and Free
• Scalable and Extensible
3.
High Level
• Pythonis close to human language,
• not machine language.
• don’t have to manage memory or hardware details.
• Example
print(“helllllo Universeee”)
4.
Interpreted Language
• Pythoncode is executed line by line.
• No need to compile before running.
• Errors are shown immediately.
• Code → Interpreter → Output
5.
Object-Oriented
• Python supportsclasses and objects
• Helps organize large programs into reusable components.
• Follows OOP concepts:
• Encapsulation
• Inheritance
• Polymorphism
• Abstraction
• Example
class Student:
def __init__(self, name):
self.name = name
6.
Dynamically Typed
• Noneed to declare variable types.
• DataType is decided at runtime.
• Example
x = 10 # integer
x = "AI" # string
Open Source andFree
• Python is free to use, modify, and distribute.
• Source code is publicly available.
• Supported by a large global community.
• No license cost for individuals or companies.
9.
Scalable
• Can growwith project size.
• Used by companies like Google, Netflix, and Instagram.
• Python works for:
• Small scripts
• Medium applications
• Large enterprise systems
10.
Extensible
• Python canintegrate with:
• C / C++
• Java
• Databases
• APIs
• Performance-critical parts can be written in faster languages.
11.
Important terms toknow
• Function - A function is a reusable block of code that performs a specific
task.
• Module - A module is a single Python file (.py) that contains functions,
variables, or classes.
• Library - A library is a collection of modules that provide related
functionality.
• Package - A package is a collection of modules organized in folders.
12.
• Class -A class is a blueprint for creating objects. It defines variables and methods.
• Object - An object is a real instance of a class. It represents real-world entities and
contains data (variables) and behavior (methods).
• Keyword - they are reserved words with predefined meaning in Python.
• Indentation - defines code blocks instead of { }.
• Namespace - is a container that holds variable names and their values.
• Scope - defines where a variable can be accessed.
• Generator - produces values one at a time using yield.
13.
DJANGO
• Django isa high-level Python web framework used to build secure,
scalable, and maintainable web applications quickly.
• Django helps you build backend web applications without reinventing
the wheel.
14.
WHY DJANGO
• Fastdevelopment – lots of built-in features
• Secure by default – protects against common attacks
• Follows best practices – clean, organized code
• Batteries included – admin panel, ORM, auth, forms
• Used by big companies (Instagram, Pinterest, Mozilla)
15.
M V TDESIGN PATTERN
• Model - The data you want to present, usually data from a database.
• View - A request handler that returns the relevant template and
content - based on the request from the user
• Template - A text file (like an HTML file) containing the layout of the
web page, with logic on how to display the data.
16.
Component Role EasyMeaning
Model Database logic Tables & data
View Business logic Brain of app
Template UI HTML pages
17.
• Django receivesthe URL, checks the urls.py file, and calls the view that
matches the URL.
• The view, located in views.py, checks for relevant models.
• The models are imported from the models.py file.
• The view then sends the data to a specified template in
the template folder.
• The template contains HTML and Django tags, and with the data it
returns finished HTML content back to the browser.