N G
I 5
M2 0 2
A M 6
.
R2 5 . 0
G-
O
R ON
PE S S I
NT S
O
H RS
T I
PYO U R
F
Y
WHAT IS PYTHON?
• High-level, interpreted
programming language.
• Created by Guido van Rossum in
1991.
• Emphasizes readability and
simplicity.
• Popular for web development,
data science, automation, AI, etc.
• WHY LEARN PYTHON?
• SIMPLE SYNTAX – EASY FOR BEGINNERS.
• VAST STANDARD LIBRARY AND ACTIVE
COMMUNITY.
• SUPPORTS MULTIPLE PROGRAMMING
PARADIGMS:
• PROCEDURAL
• OBJECT-ORIENTED
• FUNCTIONAL
• USED BY TOP COMPANIES: GOOGLE, NETFLIX,
NASA.
FEATURES OF PYTHON
• OPEN SOURCE AND FREE TO USE.
• INTERPRETED AND DYNAMICALLY TYPED.
• PORTABLE AND EXTENSIBLE.
• LARGE STANDARD LIBRARY.
• INTEGRATES WITH C, C++, JAVA.
• GUI SUPPORT (TKINTER, PYQT).
• EXCELLENT FOR SCRIPTING AND RAPID
DEVELOPMENT.
APPLICATIONS OF PYTHON
• WEB DEVELOPMENT (DJANGO, FLASK)
• DATA SCIENCE AND MACHINE LEARNING
(PANDAS, NUMPY, SCIKIT-LEARN)
• AUTOMATION/SCRIPTING
• GAME DEVELOPMENT
• DESKTOP APPLICATIONS
• IOT AND ROBOTICS
INSTALLING PYTHON
• DOWNLOAD FROM HTTPS://PYTHON.ORG
• INSTALL IDES:
• IDLE (DEFAULT)
• VS CODE
• PYCHARM
• JUPYTER NOTEBOOK
FIRST PYTHON PROGRAM
print("Hello, World!")
print() is a built-in function.
No need for semicolons or main function.
Indentation is mandatory for blocks.
STRUCTURE OF A PYTHON PROGRAM
Documentation/Comments
Single-line: # This is a comment
Multi-line: '''This is a multi-line comment'''
Import Statements
import math
from datetime import datetime
Function Definitions
def greet():
Main Program Execution
if __name__ == "__main__":
greet()
BASIC ELEMENTS OF PYTHON
• Variables and Data Types
• Operators
• Control Statements (if, for, while)
• Functions
• Modules
• Classes and Objects
PYTHON SYNTAX HIGHLIGHTS
• Case-sensitive.
• Indentation replaces curly braces.
• No need for variable declarations.
• Dynamic typing (no need to
declare data types).
VARIABLES IN PYTHON
• Variable: A name that refers to a value stored in memory.
• No need to declare the type.
• Variable is created when a value is assigned.
RULES FOR NAMING VARIABLES:
Must begin with a letter or underscore.
Can contain letters, digits, and
underscores.
Case-sensitive (Age and age are
different).
Avoid Python keywords (if, class, True,
etc.).
DATA TYPES IN PYTHON
Python has dynamic typing – no need to declare type explicitly.
Common Data Types: