BASIC
OF
PYTHON
WHAT IS PYHTON PROGRAMMING
LANGUAGE ?
• PYTHON IS A HIGH-LEVEL PROGRAMMING LANGUAGE.
• IT IS SIMPLE AND EASY TO UNDERSTAND.
• IT HAS ENGLISH-LIKE SYNTAX.
• PYTHON IS USED IN WEB, AI, DATA SCIENCE, AND AUTOMATION.
• IT IS FREE, OPEN-SOURCE, AND CROSS-PLATEFORM.
Features Of Programming Language
• SIMPLICITY :- EASY TO LEARN AND USE.
• READABILITY :- CODE SHOULD BE EASY TO READ AND UNDERSTAND.
• PORTABILITY :- CAN RUN ON DIFFERENT COMPUTERS/OPERATING
SYSTEMS.
• SECURITY :- PROVIDES ERROR HANDLING AND PROTECTS FROM MISUSE .
• REUSABILITY :- SAME CODE CAN BE USED AGAIN IN OTHER PROGRAMS .
Application of python
• WEB DEVELOPMENT
• DATA SCIENCE & ML
• AI & AUTOMATION
• GAME DEVELOPMENT
Data Types(Basic+ Collections)
 BASIC TYPES:-
• Numeric : Int, Float, Complex
• String: Str
• Boolean: True/False
• None: None type
 COLLECTION TYPES:-
• List : Odered, Changeable
• Tuple : Odered, Unchangeable
• Dictionary : Key: value pairs
A = 10 # Int
B = “Hello” # String
C = [1,2,3] # List
OPERATORS:-
 OPERATORS:
• Arithmetic : Used for mathematical operations (+, -, /, %)
• Relational : Used to compare values(True/False) (>,<, ==)
• Logical : Used with conditions. (and, or, not)
Conditional Statement:-
• If :- Used to check one condition. If it’s true: run the code.
• If-else :- Used when we want to run one block if condition is true and another block if it’s false.
• If-Elif-else :- Used when we want to check multiple conditions.
If condition example:-
x = 10
if x > 5:
print(“x is greater than 5”) [output: x is greater than 5]
If-else condition example:-
num = 4
if num % 2 == 0:
print(“Even number”)
print(“Odd number”) [Output:
Even number]
If- Elif-else example:-
marks = 75
if marks >= 90:
print(“Grade A”)
Elif marks >= 60:
print(“Grade B”)
else:
print(“Grade C”) [Output: Grade B]
Functions + String & List Methods
 FUNCTIO NS:
• Built-in (print(), len())
• User-defined (def keyword)
ST RING MET HO DS: UPPER(), LOWER(), REPLACE()
LIST METHODS: APPEND(), POP(), SO RT( )
Def add(a, b):
return a + b
Print(add(5, 3))

Simple Python Basics for Beginners Guide

  • 1.
  • 2.
    WHAT IS PYHTONPROGRAMMING LANGUAGE ? • PYTHON IS A HIGH-LEVEL PROGRAMMING LANGUAGE. • IT IS SIMPLE AND EASY TO UNDERSTAND. • IT HAS ENGLISH-LIKE SYNTAX. • PYTHON IS USED IN WEB, AI, DATA SCIENCE, AND AUTOMATION. • IT IS FREE, OPEN-SOURCE, AND CROSS-PLATEFORM.
  • 3.
    Features Of ProgrammingLanguage • SIMPLICITY :- EASY TO LEARN AND USE. • READABILITY :- CODE SHOULD BE EASY TO READ AND UNDERSTAND. • PORTABILITY :- CAN RUN ON DIFFERENT COMPUTERS/OPERATING SYSTEMS. • SECURITY :- PROVIDES ERROR HANDLING AND PROTECTS FROM MISUSE . • REUSABILITY :- SAME CODE CAN BE USED AGAIN IN OTHER PROGRAMS .
  • 4.
    Application of python •WEB DEVELOPMENT • DATA SCIENCE & ML • AI & AUTOMATION • GAME DEVELOPMENT
  • 5.
    Data Types(Basic+ Collections) BASIC TYPES:- • Numeric : Int, Float, Complex • String: Str • Boolean: True/False • None: None type  COLLECTION TYPES:- • List : Odered, Changeable • Tuple : Odered, Unchangeable • Dictionary : Key: value pairs A = 10 # Int B = “Hello” # String C = [1,2,3] # List
  • 6.
    OPERATORS:-  OPERATORS: • Arithmetic: Used for mathematical operations (+, -, /, %) • Relational : Used to compare values(True/False) (>,<, ==) • Logical : Used with conditions. (and, or, not)
  • 7.
    Conditional Statement:- • If:- Used to check one condition. If it’s true: run the code. • If-else :- Used when we want to run one block if condition is true and another block if it’s false. • If-Elif-else :- Used when we want to check multiple conditions. If condition example:- x = 10 if x > 5: print(“x is greater than 5”) [output: x is greater than 5] If-else condition example:- num = 4 if num % 2 == 0: print(“Even number”) print(“Odd number”) [Output: Even number] If- Elif-else example:- marks = 75 if marks >= 90: print(“Grade A”) Elif marks >= 60: print(“Grade B”) else: print(“Grade C”) [Output: Grade B]
  • 8.
    Functions + String& List Methods  FUNCTIO NS: • Built-in (print(), len()) • User-defined (def keyword) ST RING MET HO DS: UPPER(), LOWER(), REPLACE() LIST METHODS: APPEND(), POP(), SO RT( ) Def add(a, b): return a + b Print(add(5, 3))